]> source.dussan.org Git - aspectj.git/commitdiff
264869: cope with badly formed source name attribute
authoraclement <aclement>
Tue, 17 Feb 2009 16:20:49 +0000 (16:20 +0000)
committeraclement <aclement>
Tue, 17 Feb 2009 16:20:49 +0000 (16:20 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java

index 5cb5ca582690e8aa87a49fe4465f1df15a363618..1b20c7c79719448b3a31ef75fbf9ae410e3f55d7 100644 (file)
@@ -179,8 +179,14 @@ public abstract class ShadowMunger implements PartialOrder.PartialComparable, IH
                if (binaryFile == null) {
                        String s = getDeclaringType().getBinaryPath();
                        File f = getDeclaringType().getSourceLocation().getSourceFile();
+                       // Replace the source file suffix with .class
                        int i = f.getPath().lastIndexOf('.');
-                       String path = f.getPath().substring(0, i) + ".class";
+                       String path = null;
+                       if (i != -1) {
+                               path = f.getPath().substring(0, i) + ".class";
+                       } else {
+                               path = f.getPath() + ".class";
+                       }
                        binaryFile = new File(s + "!" + path);
                }
                return binaryFile;