diff options
author | Andy Clement <andrew.clement@gmail.com> | 2013-02-05 10:45:03 -0800 |
---|---|---|
committer | Andy Clement <andrew.clement@gmail.com> | 2013-02-05 10:45:03 -0800 |
commit | 46f90792c01a4333eb62bc2ea6a1dcfb3efb0d23 (patch) | |
tree | cb87366ed08b03f6a9a32a6084878406b4c7aaca | |
parent | 4af4b1e634c9dbb8af1741aad22a2c3441aa1751 (diff) | |
download | aspectj-46f90792c01a4333eb62bc2ea6a1dcfb3efb0d23.tar.gz aspectj-46f90792c01a4333eb62bc2ea6a1dcfb3efb0d23.zip |
394535: fix
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/TypeVariable.java | 4 | ||||
-rw-r--r-- | tests/bugs172/pr394535/Bug.java | 23 | ||||
-rw-r--r-- | tests/bugs172/pr394535/Bug2.java | 19 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc172/Ajc172Tests.java | 18 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc172/ajc172.xml | 7 |
5 files changed, 64 insertions, 7 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/TypeVariable.java b/org.aspectj.matcher/src/org/aspectj/weaver/TypeVariable.java index d6ec997f6..2e0409bc9 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/TypeVariable.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/TypeVariable.java @@ -256,8 +256,8 @@ public class TypeVariable { sb.append(":"); sb.append(superclass.getSignature()); if (superInterfaces.length != 0) { - sb.append(":"); for (int i = 0; i < superInterfaces.length; i++) { + sb.append(":"); UnresolvedType iBound = superInterfaces[i]; sb.append(iBound.getSignature()); } @@ -276,8 +276,8 @@ public class TypeVariable { sb.append(((ResolvedType) superclass).getSignatureForAttribute()); } if (superInterfaces.length != 0) { - sb.append(":"); for (int i = 0; i < superInterfaces.length; i++) { + sb.append(":"); ResolvedType iBound = (ResolvedType) superInterfaces[i]; sb.append(iBound.getSignatureForAttribute()); } diff --git a/tests/bugs172/pr394535/Bug.java b/tests/bugs172/pr394535/Bug.java new file mode 100644 index 000000000..8370a59b3 --- /dev/null +++ b/tests/bugs172/pr394535/Bug.java @@ -0,0 +1,23 @@ + +aspect X { + declare parents: Bug.ClassA implements java.io.Serializable; +} +public class Bug { + +// @org.springframework.beans.factory.annotation.Configurable + public static class ClassA<T extends Interface1 & Interface2> { + } + + public static class ClassB extends ClassA<ClassB> implements Interface1, Interface2 { + } + + public interface Interface1 { + } + + public interface Interface2 { + } + + public static void main(String[] args) throws Exception { + System.out.println(ClassB.class.getGenericSuperclass()); + } +} diff --git a/tests/bugs172/pr394535/Bug2.java b/tests/bugs172/pr394535/Bug2.java new file mode 100644 index 000000000..d5940e6ad --- /dev/null +++ b/tests/bugs172/pr394535/Bug2.java @@ -0,0 +1,19 @@ + +public class Bug2 { + + public static class ClassA2<T extends Interface12 & Interface22> implements java.io.Serializable { + } + + public static class ClassB2 extends ClassA2<ClassB2> implements Interface12, Interface22 { + } + + public interface Interface12 { + } + + public interface Interface22 { + } + + public static void main(String[] args) throws Exception { + System.out.println(ClassB2.class.getGenericSuperclass()); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc172/Ajc172Tests.java b/tests/src/org/aspectj/systemtest/ajc172/Ajc172Tests.java index e6f5c292c..059faf8a5 100644 --- a/tests/src/org/aspectj/systemtest/ajc172/Ajc172Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc172/Ajc172Tests.java @@ -23,6 +23,19 @@ import org.aspectj.testing.XMLBasedAjcTestCase; */ public class Ajc172Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + // if the test is failing because the classes won't run, remove the run blocks from the ajc172.xml entry and re-run to check signatures. + public void testSignatures_pr394535() throws Exception { + runTest("signatures"); + + JavaClass jc = getClassFrom(ajc.getSandboxDirectory(),"Bug2$ClassA2"); // the working one + String sss = jc.getSignatureAttribute().getSignature(); + assertEquals("<T::LBug2$Interface12;:LBug2$Interface22;>Ljava/lang/Object;Ljava/io/Serializable;", sss); + + jc = getClassFrom(ajc.getSandboxDirectory(),"Bug$ClassA"); + sss = jc.getSignatureAttribute().getSignature(); + assertEquals("<T::LBug$Interface1;:LBug$Interface2;>Ljava/lang/Object;Ljava/io/Serializable;", sss); + } + // extends public void testPSignatures_pr399590() throws Exception { runTest("p signatures 1"); @@ -32,7 +45,6 @@ public class Ajc172Tests extends org.aspectj.testing.XMLBasedAjcTestCase { jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); sss = jc.getSignatureAttribute().getSignature(); assertEquals("<T:LAnimal2<+LCage2<TT;>;>;>LBar2;Ljava/io/Serializable;", sss); - jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); } // extends two classes @@ -44,7 +56,6 @@ public class Ajc172Tests extends org.aspectj.testing.XMLBasedAjcTestCase { jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); sss = jc.getSignatureAttribute().getSignature(); assertEquals("<T:LAnimal2<+LCage2<TT;LIntf2;>;LIntf2;>;Q:Ljava/lang/Object;>LBar2;Ljava/io/Serializable;", sss); - jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); } // super @@ -56,7 +67,6 @@ public class Ajc172Tests extends org.aspectj.testing.XMLBasedAjcTestCase { jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); sss = jc.getSignatureAttribute().getSignature(); assertEquals("<T:LAnimal2<-LXXX2<TT;>;>;>LBar2;Ljava/io/Serializable;", sss); - jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); } // super @@ -68,7 +78,6 @@ public class Ajc172Tests extends org.aspectj.testing.XMLBasedAjcTestCase { jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); sss = jc.getSignatureAttribute().getSignature(); assertEquals("<T:LAnimal2<-LXXX2<TT;>;LYYY2;>;>LBar2;Ljava/io/Serializable;", sss); - jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); } // unbound @@ -80,7 +89,6 @@ public class Ajc172Tests extends org.aspectj.testing.XMLBasedAjcTestCase { jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); sss = jc.getSignatureAttribute().getSignature(); assertEquals("<T:LAnimal2<*>;>LBar2;Ljava/io/Serializable;", sss); - jc = getClassFrom(ajc.getSandboxDirectory(),"Cage2"); } public void testIfPointcutNames_pr398246() throws Exception { diff --git a/tests/src/org/aspectj/systemtest/ajc172/ajc172.xml b/tests/src/org/aspectj/systemtest/ajc172/ajc172.xml index 6d6ffa6f8..5c0739fb2 100644 --- a/tests/src/org/aspectj/systemtest/ajc172/ajc172.xml +++ b/tests/src/org/aspectj/systemtest/ajc172/ajc172.xml @@ -2,6 +2,13 @@ <suite> + <ajc-test dir="bugs172/pr394535" title="signatures"> + <compile files="Bug.java" options="-1.5"/> + <compile files="Bug2.java" options="-1.5"/> + <run class="Bug2"/> + <run class="Bug"/> + </ajc-test> + <ajc-test dir="bugs172/pr399590" title="p signatures 1"> <compile files="Cage.java" options="-1.5"/> <compile files="Cage2.java" options="-1.5"/> |