aboutsummaryrefslogtreecommitdiffstats
path: root/asm/src
diff options
context:
space:
mode:
authoracolyer <acolyer>2003-09-12 19:24:14 +0000
committeracolyer <acolyer>2003-09-12 19:24:14 +0000
commitad0dd8b3fdc19a961b039f9dad16711d9d20250b (patch)
tree7e28f814f0b612216fcd7af2c3f35db975700911 /asm/src
parentb5127388a3b5a2403e8d8944766bbe1895e09530 (diff)
downloadaspectj-ad0dd8b3fdc19a961b039f9dad16711d9d20250b.tar.gz
aspectj-ad0dd8b3fdc19a961b039f9dad16711d9d20250b.zip
always canonicalize the file argument when searching for nodes by file and/or line.
Diffstat (limited to 'asm/src')
-rw-r--r--asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
index e8c7f2241..f0cbd333a 100644
--- a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
+++ b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
@@ -175,7 +175,8 @@ public class AspectJElementHierarchy implements IHierarchy {
if (!isValid() || sourceFile == null) {
return IHierarchy.NO_STRUCTURE;
} else {
- String correctedPath = new File(sourceFile).getAbsolutePath();//.replace('\\', '/');
+ String correctedPath =
+ AsmManager.getDefault().getCanonicalFilePath(new File(sourceFile));
//StructureNode node = (StructureNode)getFileMap().get(correctedPath);//findFileNode(filePath, model);
IProgramElement node = (IProgramElement)findInFileMap(correctedPath);//findFileNode(filePath, model);
if (node != null) {
@@ -194,7 +195,10 @@ public class AspectJElementHierarchy implements IHierarchy {
*/
public IProgramElement findElementForSourceLine(ISourceLocation location) {
try {
- return findElementForSourceLine(location.getSourceFile().getAbsolutePath(), location.getLine());
+ return findElementForSourceLine(
+ AsmManager.getDefault().getCanonicalFilePath(
+ location.getSourceFile()),
+ location.getLine());
} catch (Exception e) {
return null;
}
@@ -208,7 +212,9 @@ public class AspectJElementHierarchy implements IHierarchy {
* @return a new structure node for the file if it was not found in the model
*/
public IProgramElement findElementForSourceLine(String sourceFilePath, int lineNumber) {
- IProgramElement node = findNodeForSourceLineHelper(root, sourceFilePath, lineNumber);
+ String canonicalSFP = AsmManager.getDefault().getCanonicalFilePath(
+ new File(sourceFilePath));
+ IProgramElement node = findNodeForSourceLineHelper(root, canonicalSFP, lineNumber);
if (node != null) {
return node;
} else {