From 4af4b1e634c9dbb8af1741aad22a2c3441aa1751 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Mon, 4 Feb 2013 13:33:26 -0800 Subject: [PATCH] 399590 --- .../aspectj/weaver/BoundedReferenceType.java | 22 +++++++ tests/bugs172/pr399590/Cage.java | 9 +++ tests/bugs172/pr399590/Cage2.java | 13 ++++ tests/bugs172/pr399590/five/Cage.java | 9 +++ tests/bugs172/pr399590/five/Cage2.java | 9 +++ tests/bugs172/pr399590/four/Cage.java | 11 ++++ tests/bugs172/pr399590/four/Cage2.java | 13 ++++ tests/bugs172/pr399590/three/Cage.java | 10 ++++ tests/bugs172/pr399590/three/Cage2.java | 11 ++++ tests/bugs172/pr399590/two/Cage.java | 9 +++ tests/bugs172/pr399590/two/Cage2.java | 13 ++++ .../systemtest/ajc172/Ajc172Tests.java | 60 +++++++++++++++++++ .../org/aspectj/systemtest/ajc172/ajc172.xml | 26 ++++++++ 13 files changed, 215 insertions(+) create mode 100644 tests/bugs172/pr399590/Cage.java create mode 100644 tests/bugs172/pr399590/Cage2.java create mode 100644 tests/bugs172/pr399590/five/Cage.java create mode 100644 tests/bugs172/pr399590/five/Cage2.java create mode 100644 tests/bugs172/pr399590/four/Cage.java create mode 100644 tests/bugs172/pr399590/four/Cage2.java create mode 100644 tests/bugs172/pr399590/three/Cage.java create mode 100644 tests/bugs172/pr399590/three/Cage2.java create mode 100644 tests/bugs172/pr399590/two/Cage.java create mode 100644 tests/bugs172/pr399590/two/Cage2.java diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/BoundedReferenceType.java b/org.aspectj.matcher/src/org/aspectj/weaver/BoundedReferenceType.java index 30a2e4e4c..dc28ad3c1 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/BoundedReferenceType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/BoundedReferenceType.java @@ -115,6 +115,28 @@ public class BoundedReferenceType extends ReferenceType { } } + @Override + public String getSignatureForAttribute() { + StringBuilder ret = new StringBuilder(); + if (kind==SUPER){ + ret.append("-"); + ret.append(lowerBound.getSignatureForAttribute()); + for (int i=0;i {} +class Lion extends Animal {} + +class Animal { } + +class Bar {} + +public class Cage>> extends Bar { } + diff --git a/tests/bugs172/pr399590/Cage2.java b/tests/bugs172/pr399590/Cage2.java new file mode 100644 index 000000000..4da3e4711 --- /dev/null +++ b/tests/bugs172/pr399590/Cage2.java @@ -0,0 +1,13 @@ +class LionCage2 extends Cage2 {} +class Lion2 extends Animal2 {} + +class Animal2 { } + +class Bar2 {} + +public class Cage2>> extends Bar2 { } + +aspect X { + declare parents: Cage2 implements java.io.Serializable; +} + diff --git a/tests/bugs172/pr399590/five/Cage.java b/tests/bugs172/pr399590/five/Cage.java new file mode 100644 index 000000000..f817ef10c --- /dev/null +++ b/tests/bugs172/pr399590/five/Cage.java @@ -0,0 +1,9 @@ +//class LionCage extends Cage {} +//class Lion extends Animal {} + +class Animal { } + +class Bar {} + + +public class Cage> extends Bar { } diff --git a/tests/bugs172/pr399590/five/Cage2.java b/tests/bugs172/pr399590/five/Cage2.java new file mode 100644 index 000000000..94a3e4331 --- /dev/null +++ b/tests/bugs172/pr399590/five/Cage2.java @@ -0,0 +1,9 @@ +class Animal2 { } + +class Bar2 {} + +public class Cage2> extends Bar2 { } + +aspect X { + declare parents: Cage2 implements java.io.Serializable; +} diff --git a/tests/bugs172/pr399590/four/Cage.java b/tests/bugs172/pr399590/four/Cage.java new file mode 100644 index 000000000..68414b59e --- /dev/null +++ b/tests/bugs172/pr399590/four/Cage.java @@ -0,0 +1,11 @@ +//class LionCage extends Cage {} +//class Lion extends Animal {} + +class Animal { } + +class Bar {} + +interface XXX {} +interface YYY {} + +public class Cage,YYY>> extends Bar { } diff --git a/tests/bugs172/pr399590/four/Cage2.java b/tests/bugs172/pr399590/four/Cage2.java new file mode 100644 index 000000000..9b9ba0f1a --- /dev/null +++ b/tests/bugs172/pr399590/four/Cage2.java @@ -0,0 +1,13 @@ +class Animal2 { } + +class Bar2 {} + +interface XXX2 {} + +interface YYY2 {} + +public class Cage2,YYY2>> extends Bar2 { } + +aspect X { + declare parents: Cage2 implements java.io.Serializable; +} diff --git a/tests/bugs172/pr399590/three/Cage.java b/tests/bugs172/pr399590/three/Cage.java new file mode 100644 index 000000000..8882c45a4 --- /dev/null +++ b/tests/bugs172/pr399590/three/Cage.java @@ -0,0 +1,10 @@ +//class LionCage extends Cage {} +//class Lion extends Animal {} + +class Animal { } + +class Bar {} + +interface XXX {} + +public class Cage>> extends Bar { } diff --git a/tests/bugs172/pr399590/three/Cage2.java b/tests/bugs172/pr399590/three/Cage2.java new file mode 100644 index 000000000..d03ebd038 --- /dev/null +++ b/tests/bugs172/pr399590/three/Cage2.java @@ -0,0 +1,11 @@ +class Animal2 { } + +class Bar2 {} + +interface XXX2 {} + +public class Cage2>> extends Bar2 { } + +aspect X { + declare parents: Cage2 implements java.io.Serializable; +} diff --git a/tests/bugs172/pr399590/two/Cage.java b/tests/bugs172/pr399590/two/Cage.java new file mode 100644 index 000000000..7cdc1af64 --- /dev/null +++ b/tests/bugs172/pr399590/two/Cage.java @@ -0,0 +1,9 @@ + +class Animal { } + +class Bar {} + +class Intf {} + +public class Cage,Intf>,Q> extends Bar { } + diff --git a/tests/bugs172/pr399590/two/Cage2.java b/tests/bugs172/pr399590/two/Cage2.java new file mode 100644 index 000000000..6758be4ce --- /dev/null +++ b/tests/bugs172/pr399590/two/Cage2.java @@ -0,0 +1,13 @@ + +class Animal2 { } + +class Bar2 {} + +class Intf2 {} + +public class Cage2,Intf2>,Q> extends Bar2 { } + + +aspect X { + declare parents: Cage2 implements java.io.Serializable; +} diff --git a/tests/src/org/aspectj/systemtest/ajc172/Ajc172Tests.java b/tests/src/org/aspectj/systemtest/ajc172/Ajc172Tests.java index fd9454164..e6f5c292c 100644 --- a/tests/src/org/aspectj/systemtest/ajc172/Ajc172Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc172/Ajc172Tests.java @@ -23,6 +23,66 @@ import org.aspectj.testing.XMLBasedAjcTestCase; */ public class Ajc172Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + // extends + public void testPSignatures_pr399590() throws Exception { + runTest("p signatures 1"); + JavaClass jc = getClassFrom(ajc.getSandboxDirectory(),"Cage"); + String sss = jc.getSignatureAttribute().getSignature(); + assertEquals(";>;>LBar;", sss); + jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); + sss = jc.getSignatureAttribute().getSignature(); + assertEquals(";>;>LBar2;Ljava/io/Serializable;", sss); + jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); + } + + // extends two classes + public void testPSignatures_pr399590_2() throws Exception { + runTest("p signatures 2"); + JavaClass jc = getClassFrom(ajc.getSandboxDirectory(),"Cage"); + String sss = jc.getSignatureAttribute().getSignature(); + assertEquals(";LIntf;>;Q:Ljava/lang/Object;>LBar;", sss); + jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); + sss = jc.getSignatureAttribute().getSignature(); + assertEquals(";LIntf2;>;Q:Ljava/lang/Object;>LBar2;Ljava/io/Serializable;", sss); + jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); + } + + // super + public void testPSignatures_pr399590_3() throws Exception { + runTest("p signatures 3"); + JavaClass jc = getClassFrom(ajc.getSandboxDirectory(),"Cage"); + String sss = jc.getSignatureAttribute().getSignature(); + assertEquals(";>;>LBar;", sss); + jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); + sss = jc.getSignatureAttribute().getSignature(); + assertEquals(";>;>LBar2;Ljava/io/Serializable;", sss); + jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); + } + + // super + public void testPSignatures_pr399590_4() throws Exception { + runTest("p signatures 4"); + JavaClass jc = getClassFrom(ajc.getSandboxDirectory(),"Cage"); + String sss = jc.getSignatureAttribute().getSignature(); + assertEquals(";LYYY;>;>LBar;", sss); + jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); + sss = jc.getSignatureAttribute().getSignature(); + assertEquals(";LYYY2;>;>LBar2;Ljava/io/Serializable;", sss); + jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); + } + + // unbound + public void testPSignatures_pr399590_5() throws Exception { + runTest("p signatures 5"); + JavaClass jc = getClassFrom(ajc.getSandboxDirectory(),"Cage"); + String sss = jc.getSignatureAttribute().getSignature(); + assertEquals(";>LBar;", sss); + jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); + sss = jc.getSignatureAttribute().getSignature(); + assertEquals(";>LBar2;Ljava/io/Serializable;", sss); + jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); + } + public void testIfPointcutNames_pr398246() throws Exception { runTest("if pointcut names"); JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "X"); diff --git a/tests/src/org/aspectj/systemtest/ajc172/ajc172.xml b/tests/src/org/aspectj/systemtest/ajc172/ajc172.xml index 606ae311e..6d6ffa6f8 100644 --- a/tests/src/org/aspectj/systemtest/ajc172/ajc172.xml +++ b/tests/src/org/aspectj/systemtest/ajc172/ajc172.xml @@ -1,6 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.39.5