]> source.dussan.org Git - aspectj.git/commitdiff
weaveinfo for @AJ ITD
authoravasseur <avasseur>
Fri, 21 Oct 2005 13:18:55 +0000 (13:18 +0000)
committeravasseur <avasseur>
Fri, 21 Oct 2005 13:18:55 +0000 (13:18 +0000)
tests/src/org/aspectj/systemtest/ajc150/ataspectj/syntax.xml
weaver/src/org/aspectj/weaver/MethodDelegateTypeMunger.java
weaver/src/org/aspectj/weaver/ResolvedTypeMunger.java

index 89f2e0f08e39209f96c3d35efef75962d92ab32a..cf6c106b0323f5740a7df68015396513b581f3e1 100644 (file)
     </ajc-test>
 
     <ajc-test dir="java5/ataspectj" title="DeclareParentsInterface">
-        <compile files="ataspectj/DeclareParentsInterfaceTest.java,ataspectj/TestHelper.java" options="-1.5 -Xdev:NoAtAspectJProcessing -Xlint:ignore"/>
+        <compile files="ataspectj/DeclareParentsInterfaceTest.java,ataspectj/TestHelper.java" options="-showWeaveInfo -1.5 -Xdev:NoAtAspectJProcessing -Xlint:ignore">
+            <message kind="weave" text="Extending interface set for type 'ataspectj.DeclareParentsInterfaceTest$Target' (DeclareParentsInterfaceTest.java) to include 'ataspectj.DeclareParentsInterfaceTest$Marker' (DeclareParentsInterfaceTest.java)"/>
+            <message kind="weave" text="Join point "/>
+        </compile>
         <run class="ataspectj.DeclareParentsInterfaceTest"/>
     </ajc-test>
 
     <ajc-test dir="java5/ataspectj" title="DeclareParentsImplements">
-        <compile files="ataspectj/DeclareParentsImplementsTest.java,ataspectj/TestHelper.java" options="-1.5 -Xdev:NoAtAspectJProcessing -Xlint:ignore"/>
+        <compile files="ataspectj/DeclareParentsImplementsTest.java,ataspectj/TestHelper.java" options="-showWeaveInfo -1.5 -Xdev:NoAtAspectJProcessing -Xlint:ignore">
+            <message kind="weave" text="Join point "/>
+            <message kind="weave" text="Extending interface set for type 'ataspectj.DeclareParentsImplementsTest$Target' (DeclareParentsImplementsTest.java) to include 'ataspectj.DeclareParentsImplementsTest$Introduced' (DeclareParentsImplementsTest.java)"/>
+            <message kind="weave" text="Type 'ataspectj.DeclareParentsImplementsTest$Target' (DeclareParentsImplementsTest.java) has intertyped method from 'ataspectj.DeclareParentsImplementsTest$TestAspect' (DeclareParentsImplementsTest.java:'void ataspectj.DeclareParentsImplementsTest$Introduced.intro()')"/>
+        </compile>
         <run class="ataspectj.DeclareParentsImplementsTest"/>
     </ajc-test>
 
index 26ae5b21dda3863539e1a64b69e4723f249bdd7e..e7bc20d3b7e85b63972e9786f9d70b0acebbb5b1 100644 (file)
@@ -58,7 +58,7 @@ public class MethodDelegateTypeMunger extends ResolvedTypeMunger {
                 break;
             }
         }
-        if (field == null) {
+        if (field == null) {           
             throw new RuntimeException("Should not happen: aspect field not found for @DeclareParents delegate");
         } else {
             aspectFieldDelegate = field;
index 1389d78c6c0e9a4db5817743091ff74afedb09ab..7717915f1d197457005ea6ed4635e521f3c65d66 100644 (file)
@@ -243,7 +243,16 @@ public abstract class ResolvedTypeMunger {
             }
                throw new BCException("bad kind: " + key);
            }
-       }
+
+        public String toString() {
+            // we want MethodDelegate to appear as Method in WeaveInfo messages
+            if (MethodDelegate.getName().equals(getName())) {
+                return Method.toString();
+            } else {
+                return super.toString();
+            }
+        }
+    }
        
        // ---- fields