]> source.dussan.org Git - aspectj.git/commitdiff
Fix for Bugzilla Bug 71878
authoraclement <aclement>
Fri, 13 Aug 2004 14:49:39 +0000 (14:49 +0000)
committeraclement <aclement>
Fri, 13 Aug 2004 14:49:39 +0000 (14:49 +0000)
   Bad injar aspect name on Linux

asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java

index da1b09e3809305c956b27eb5061d947860fbb780..448540802173cbf93466c495faa1f70d7449223f 100644 (file)
@@ -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);