diff options
author | acolyer <acolyer> | 2003-09-11 08:49:21 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2003-09-11 08:49:21 +0000 |
commit | ef280812570d55aa946ff8217066201288ec5bdf (patch) | |
tree | f8eb653f898adf3180692b1f2fda50c73daa56dc /asm | |
parent | a29afa3b913ae6a689ec99dba1f9d2c0db3ca87b (diff) | |
download | aspectj-ef280812570d55aa946ff8217066201288ec5bdf.tar.gz aspectj-ef280812570d55aa946ff8217066201288ec5bdf.zip |
remember handleIdentifier once calculated, use canonical file path map
Diffstat (limited to 'asm')
-rw-r--r-- | asm/src/org/aspectj/asm/internal/ProgramElement.java | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/asm/src/org/aspectj/asm/internal/ProgramElement.java b/asm/src/org/aspectj/asm/internal/ProgramElement.java index 327a88d78..b09bd79d0 100644 --- a/asm/src/org/aspectj/asm/internal/ProgramElement.java +++ b/asm/src/org/aspectj/asm/internal/ProgramElement.java @@ -414,38 +414,31 @@ public class ProgramElement implements IProgramElement { return label; } - // TODO: determine if using canonical path incurrs performance overhead public static String createHandleIdentifier(File sourceFile, int line,int column) { -// try { StringBuffer sb = new StringBuffer(); - sb.append(sourceFile.getAbsolutePath()); + sb.append(AsmManager.getDefault().getCanonicalFilePath(sourceFile)); sb.append(ID_DELIM); sb.append(line); sb.append(ID_DELIM); sb.append(column); return sb.toString(); -// } catch (IOException ioe) { -// ioe.printStackTrace(); -// return null; -// } } + private String handle = null; public String getHandleIdentifier() { -// try { - StringBuffer sb = new StringBuffer(); - if (sourceLocation == null) { - return null; - } else { - sb.append(sourceLocation.getSourceFile().getAbsolutePath()); - sb.append(ID_DELIM); - sb.append(sourceLocation.getLine()); - sb.append(ID_DELIM); - sb.append(sourceLocation.getColumn()); - return sb.toString(); - } -// } catch (IOException ioe) { -// return null; -// } + if (null == handle) { + if (sourceLocation != null) { + StringBuffer sb = new StringBuffer(); + sb.append(AsmManager.getDefault() + .getCanonicalFilePath(sourceLocation.getSourceFile())); + sb.append(ID_DELIM); + sb.append(sourceLocation.getLine()); + sb.append(ID_DELIM); + sb.append(sourceLocation.getColumn()); + handle = sb.toString(); + } + } + return handle; } public List getParameterNames() { |