Mercurial > hg > graal-compiler
comparison 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 |
comparison
equal
deleted
inserted
replaced
15365:0aed1c2d0caa | 15371:c54f5fa05fd5 |
---|---|
68 } | 68 } |
69 | 69 |
70 /** | 70 /** |
71 * Gets the canonical representation of a source file, whose contents will be read lazily and | 71 * Gets the canonical representation of a source file, whose contents will be read lazily and |
72 * then cached. | 72 * then cached. |
73 * | 73 * |
74 * @param reset forces any existing {@link Source} cache to be cleared, forcing a re-read | 74 * @param reset forces any existing {@link Source} cache to be cleared, forcing a re-read |
75 */ | 75 */ |
76 public Source get(String fileName, boolean reset) { | 76 public Source get(String fileName, boolean reset) { |
77 | 77 |
78 SourceImpl source = pathToSource.get(fileName); | 78 SourceImpl source = pathToSource.get(fileName); |
225 public String getName() { | 225 public String getName() { |
226 return name; | 226 return name; |
227 } | 227 } |
228 | 228 |
229 @Override | 229 @Override |
230 public String getShortName() { | |
231 return name; | |
232 } | |
233 | |
234 @Override | |
230 public String getCode() { | 235 public String getCode() { |
231 return code; | 236 return code; |
232 } | 237 } |
233 | 238 |
234 @Override | 239 @Override |
287 } | 292 } |
288 | 293 |
289 @Override | 294 @Override |
290 public String getName() { | 295 public String getName() { |
291 return name; | 296 return name; |
297 } | |
298 | |
299 @Override | |
300 public String getShortName() { | |
301 return file.getName(); | |
292 } | 302 } |
293 | 303 |
294 @Override | 304 @Override |
295 public String getCode() { | 305 public String getCode() { |
296 if (code == null || timeStamp != file.lastModified()) { | 306 if (code == null || timeStamp != file.lastModified()) { |