Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/SourceManager.java @ 15371:c54f5fa05fd5
Truffle: add getShortName and getShortDescription to Source and SourceSection for when we don't need full paths.
author | Chris Seaton <chris.seaton@oracle.com> |
---|---|
date | Thu, 24 Apr 2014 23:29:04 +0100 |
parents | f150a67b99e3 |
children | 2d63ce48d222 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/SourceManager.java Thu Apr 24 17:31:25 2014 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/SourceManager.java Thu Apr 24 23:29:04 2014 +0100 @@ -70,7 +70,7 @@ /** * Gets the canonical representation of a source file, whose contents will be read lazily and * then cached. - * + * * @param reset forces any existing {@link Source} cache to be cleared, forcing a re-read */ public Source get(String fileName, boolean reset) { @@ -227,6 +227,11 @@ } @Override + public String getShortName() { + return name; + } + + @Override public String getCode() { return code; } @@ -292,6 +297,11 @@ } @Override + public String getShortName() { + return file.getName(); + } + + @Override public String getCode() { if (code == null || timeStamp != file.lastModified()) { try {