]> source.dussan.org Git - aspectj.git/commitdiff
239910: fix
authoraclement <aclement>
Tue, 8 Jul 2008 15:45:10 +0000 (15:45 +0000)
committeraclement <aclement>
Tue, 8 Jul 2008 15:45:10 +0000 (15:45 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java

index 32414f0ce2445574fea5d25c7356a69441c51237..5ffa4518495ed50f9149b69abec4b664c6affbf4 100644 (file)
@@ -290,8 +290,9 @@ public class BcelWeaver {
                ClassParser parser = new ClassParser(new ByteArrayInputStream(bytes),name);
                JavaClass jc = parser.parse();
                ResolvedType type = world.addSourceObjectType(jc).getResolvedTypeX();
+               if (!type.isAspect()) return;
                String typeName = type.getName().replace('.', File.separatorChar);
-               int end = name.lastIndexOf(typeName);
+               int end = name.indexOf(typeName+".class");
                String binaryPath = null;
                // if end is -1 then something wierd happened, the class file is not in the correct place, something like
                // bin/A.class when the declaration for A specifies it is in a package.
@@ -300,10 +301,8 @@ public class BcelWeaver {
                } else {
                        binaryPath = name.substring(0,end-1);
                }
-               type.setBinaryPath(binaryPath);
-               if (type.isAspect()) {
-                       toList.add(type);
-               }               
+               type.setBinaryPath(binaryPath);         
+               toList.add(type);
        }