]> source.dussan.org Git - aspectj.git/commitdiff
Works on Linux too :)
authoracolyer <acolyer>
Wed, 4 Aug 2004 13:37:56 +0000 (13:37 +0000)
committeracolyer <acolyer>
Wed, 4 Aug 2004 13:37:56 +0000 (13:37 +0000)
weaver/src/org/aspectj/weaver/Shadow.java

index b34f62e7ea1b08fe2aec801eabf0ddbbe7aa18b3..58ae6e7233f854ccc3fb36ae5da0de78189a420b 100644 (file)
@@ -356,7 +356,12 @@ public abstract class Shadow {
                if (isl==null || isl.getSourceFile()==null || isl.getSourceFile().getName().indexOf("no debug info available")!=-1) {
                        nice.append("no debug info available");
            } else {
-               nice.append(isl.getSourceFile().getName());
+               // can't use File.getName() as this fails when a Linux box encounters a path created on Windows and vice-versa
+               int takeFrom = isl.getSourceFile().getPath().lastIndexOf('/');
+               if (takeFrom == -1) {
+                       takeFrom = isl.getSourceFile().getPath().lastIndexOf('\\');
+               }                       
+               nice.append(isl.getSourceFile().getPath().substring(takeFrom +1));
                if (isl.getLine()!=0) nice.append(":").append(isl.getLine());
                }
                return nice.toString();