aboutsummaryrefslogtreecommitdiffstats
path: root/asm
diff options
context:
space:
mode:
authoraclement <aclement>2004-08-13 14:49:39 +0000
committeraclement <aclement>2004-08-13 14:49:39 +0000
commit2dfc73855a1d7ab7652476729e6575f9116e12b8 (patch)
tree83ba67a6aa024c4936395471a6436eab85815641 /asm
parent98c78c9c39384fa1c4734097308e5b38f1f83072 (diff)
downloadaspectj-2dfc73855a1d7ab7652476729e6575f9116e12b8.tar.gz
aspectj-2dfc73855a1d7ab7652476729e6575f9116e12b8.zip
Fix for Bugzilla Bug 71878
Bad injar aspect name on Linux
Diffstat (limited to 'asm')
-rw-r--r--asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
index da1b09e38..448540802 100644
--- a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
+++ b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
@@ -240,7 +240,12 @@ public class AspectJElementHierarchy implements IHierarchy {
}
private IProgramElement createFileStructureNode(String sourceFilePath) {
- String fileName = new File(sourceFilePath).getName();
+ // SourceFilePath might have originated on windows on linux...
+ int lastSlash = sourceFilePath.lastIndexOf('\\');
+ if (lastSlash == -1) {
+ lastSlash = sourceFilePath.lastIndexOf('/');
+ }
+ String fileName = sourceFilePath.substring(lastSlash+1);
IProgramElement fileNode = new ProgramElement(fileName, IProgramElement.Kind.FILE_JAVA, null);
fileNode.setSourceLocation(new SourceLocation(new File(sourceFilePath), 1, 1));
fileNode.addChild(NO_STRUCTURE);