diff options
-rw-r--r-- | tests/bugs150/pr112476/case1/lib/A.java | 8 | ||||
-rw-r--r-- | tests/bugs150/pr112476/case1/lib/B.java | 9 | ||||
-rw-r--r-- | tests/bugs150/pr112476/case1/lib/C.java | 14 | ||||
-rw-r--r-- | tests/bugs150/pr112476/case1/weaved/DeclareAspect.aj | 5 | ||||
-rw-r--r-- | tests/bugs150/pr112476/case1/weaved/SuperC.java | 17 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 1 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 20 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java | 2 |
8 files changed, 72 insertions, 4 deletions
diff --git a/tests/bugs150/pr112476/case1/lib/A.java b/tests/bugs150/pr112476/case1/lib/A.java new file mode 100644 index 000000000..dc0641af1 --- /dev/null +++ b/tests/bugs150/pr112476/case1/lib/A.java @@ -0,0 +1,8 @@ +package lib; + +public class A { + + public A(String s) { + } + +} diff --git a/tests/bugs150/pr112476/case1/lib/B.java b/tests/bugs150/pr112476/case1/lib/B.java new file mode 100644 index 000000000..2436e248b --- /dev/null +++ b/tests/bugs150/pr112476/case1/lib/B.java @@ -0,0 +1,9 @@ +package lib; + +public class B extends A{ + + public B(String s) { + super(s); + } + +} diff --git a/tests/bugs150/pr112476/case1/lib/C.java b/tests/bugs150/pr112476/case1/lib/C.java new file mode 100644 index 000000000..3760bf277 --- /dev/null +++ b/tests/bugs150/pr112476/case1/lib/C.java @@ -0,0 +1,14 @@ +/* + * Created on Oct 13, 2005 + * \u00462004-2005 Business Process Engineering S.r.L. All rights reserved + */ + +package lib; + +public class C extends B { + + public C(String s) { + super(s); + } + +} diff --git a/tests/bugs150/pr112476/case1/weaved/DeclareAspect.aj b/tests/bugs150/pr112476/case1/weaved/DeclareAspect.aj new file mode 100644 index 000000000..29feee1a4 --- /dev/null +++ b/tests/bugs150/pr112476/case1/weaved/DeclareAspect.aj @@ -0,0 +1,5 @@ +package weaved; + +public aspect DeclareAspect { + declare parents : lib.C extends SuperC; +} diff --git a/tests/bugs150/pr112476/case1/weaved/SuperC.java b/tests/bugs150/pr112476/case1/weaved/SuperC.java new file mode 100644 index 000000000..f2e1b0376 --- /dev/null +++ b/tests/bugs150/pr112476/case1/weaved/SuperC.java @@ -0,0 +1,17 @@ +package weaved; + +import lib.B; +import lib.C; + +public class SuperC extends B { + + public SuperC(String s) { + super(s); + } + + public static void main(String[] args) { + C c = new C("test"); + System.out.println("Is ["+C.class+"] subcass of ["+SuperC.class+"]? "+(SuperC.class.isAssignableFrom(c.getClass()))); + } + +} diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 8d8f2a837..26c4d16fc 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -51,6 +51,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testITDCtor_pr112783() { runTest("Problem with constructor ITDs");} */ + public void testBrokenDecp_pr112476() { runTest("binary weaving decp broken");} public void testUnboundFormal_pr112027() { runTest("unexpected error unboundFormalInPC");} public void testNPEScopeSetup_pr115038() { runTest("NPE in ensureScopeSetup");} public void testCCEGenerics_pr113445() { runTest("Generics ClassCastException");} diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index b6b5e6bf8..63481ee2f 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -3,6 +3,20 @@ <!-- AspectJ v1.5.0 Tests --> <suite> + <ajc-test dir="bugs150/pr112476/case1" title="binary weaving decp broken"> + <compile files="lib/A.java,lib/B.java,lib/C.java" outjar="library.jar" options="-1.5"/> + <!-- library.jar on the aspectpath here just for resolution when compiling SuperC --> + <compile aspectpath="library.jar" files="weaved/SuperC.java" outjar="newsuper.jar" options="-1.5"/> + <compile inpath="library.jar;newsuper.jar" files="weaved/DeclareAspect.aj" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="Setting superclass of type 'lib.C' (C.java) to 'weaved.SuperC' (DeclareAspect.aj)"/> + </compile> + <run class="weaved.SuperC"> + <stdout> + <line text="Is [class lib.C] subcass of [class weaved.SuperC]? true"/> + </stdout> + </run> + </ajc-test> + <ajc-test dir="java5/staticImports" title="import static java.lang.System.out"> <compile files="StaticImport.aj" options="-1.5"/> </ajc-test> @@ -10,7 +24,7 @@ <ajc-test dir="bugs150" title="Problem with constructor ITDs"> <compile files="pr112783.aj" options="-1.5"/> </ajc-test> - + <ajc-test dir="bugs150" title="NPE in ensureScopeSetup"> <compile files="pr115038.aj" options="-1.5"> <!-- fixme asc the 'static ref' messages are a bit poor and ought to be eliminated... --> @@ -20,12 +34,12 @@ </compile> </ajc-test> - <ajc-test dir="bugs150" title="ITDC with no explicit cons call"> + <ajc-test dir="bugs150" title="ITDC with no explicit cons call"> <compile files="Pr62606.aj" options="-1.5"> <message kind="warning" line="6" text="[Xlint:noExplicitConstructorCall]"/> </compile> </ajc-test> - + <ajc-test dir="java5/generics/bugs" title="using same type variable in ITD"> <compile files="SameTypeVariable.aj" options="-1.5"> </compile> diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java index a93d6859d..464f1e65a 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java @@ -424,7 +424,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { } } - int idx = cpg.addMethodref(newParent.getClassName(), invokeSpecial.getMethodName(cpg), invokeSpecial.getSignature(cpg)); + int idx = cpg.addMethodref(newParent.getName(), invokeSpecial.getMethodName(cpg), invokeSpecial.getSignature(cpg)); invokeSpecial.setIndex(idx); } } |