aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2016-01-27 11:49:38 -0800
committerAndy Clement <aclement@pivotal.io>2016-01-27 11:49:38 -0800
commit4bee355d22f5dd4bb2120ca725f0c8b9eb904976 (patch)
tree1fc55b64cb91c0540dfa13f1ab523af6be0852c9 /tests
parent9be47cc3a9ead4208d6247fcc5da7216c231278a (diff)
downloadaspectj-4bee355d22f5dd4bb2120ca725f0c8b9eb904976.tar.gz
aspectj-4bee355d22f5dd4bb2120ca725f0c8b9eb904976.zip
Fix 486612: Can lose a super type bound when weaving a type using generics in its declaration
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs189/486612/Azpect.java7
-rw-r--r--tests/bugs189/486612/Code.java17
-rw-r--r--tests/src/org/aspectj/systemtest/ajc189/Ajc189Tests.java16
-rw-r--r--tests/src/org/aspectj/systemtest/ajc189/ajc189.out.xml0
-rw-r--r--tests/src/org/aspectj/systemtest/ajc189/ajc189.xml5
5 files changed, 42 insertions, 3 deletions
diff --git a/tests/bugs189/486612/Azpect.java b/tests/bugs189/486612/Azpect.java
new file mode 100644
index 000000000..e5a1ba3e5
--- /dev/null
+++ b/tests/bugs189/486612/Azpect.java
@@ -0,0 +1,7 @@
+aspect Azpect {
+ declare parents: B implements I;
+ declare parents: D implements I;
+ before(): staticinitialization(!Azpect){}
+}
+
+interface I {}
diff --git a/tests/bugs189/486612/Code.java b/tests/bugs189/486612/Code.java
new file mode 100644
index 000000000..089d93244
--- /dev/null
+++ b/tests/bugs189/486612/Code.java
@@ -0,0 +1,17 @@
+import java.io.*;
+
+public class Code {
+ public static void main(String []argv) {
+ }
+}
+
+class B<T extends SomeClass & SomeInterface> extends C<T> implements Serializable {
+}
+
+class C<T> {}
+
+class SomeClass {}
+interface SomeInterface {}
+interface SomeOtherInterface {}
+
+class D<T extends SomeInterface&SomeOtherInterface> {}
diff --git a/tests/src/org/aspectj/systemtest/ajc189/Ajc189Tests.java b/tests/src/org/aspectj/systemtest/ajc189/Ajc189Tests.java
index 9d5206c4b..138787853 100644
--- a/tests/src/org/aspectj/systemtest/ajc189/Ajc189Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc189/Ajc189Tests.java
@@ -14,6 +14,7 @@ import java.io.File;
import junit.framework.Test;
+import org.aspectj.apache.bcel.classfile.JavaClass;
import org.aspectj.testing.XMLBasedAjcTestCase;
/**
@@ -21,13 +22,22 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
*/
public class Ajc189Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ public void testLostBounds() throws Exception {
+ runTest("lost bounds");
+ // This type has I added via declare parents
+ JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "B");
+ assertEquals("<T:LSomeClass;:LSomeInterface;>LC<TT;>;Ljava/io/Serializable;LI;",jc.getGenericSignature());
+ jc = getClassFrom(ajc.getSandboxDirectory(), "D");
+ assertEquals("<T::LSomeInterface;:LSomeOtherInterface;>Ljava/lang/Object;LI;",jc.getGenericSignature());
+ }
+
public void testWhileNPE_486203() throws Exception {
runTest("while npe");
}
- public void testOverweaving_352389() throws Exception {
- runTest("overweaving");
- }
+// public void testOverweaving_352389() throws Exception {
+// runTest("overweaving");
+// }
// ---
diff --git a/tests/src/org/aspectj/systemtest/ajc189/ajc189.out.xml b/tests/src/org/aspectj/systemtest/ajc189/ajc189.out.xml
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc189/ajc189.out.xml
diff --git a/tests/src/org/aspectj/systemtest/ajc189/ajc189.xml b/tests/src/org/aspectj/systemtest/ajc189/ajc189.xml
index d9b2b4226..594f7f11d 100644
--- a/tests/src/org/aspectj/systemtest/ajc189/ajc189.xml
+++ b/tests/src/org/aspectj/systemtest/ajc189/ajc189.xml
@@ -2,6 +2,11 @@
<suite>
+<ajc-test dir="bugs189/486612" title="lost bounds">
+ <compile files="Code.java Azpect.java" options="-1.8"/>
+</ajc-test>
+
+
<ajc-test dir="bugs189/486203" title="while npe">
<compile files="While.java" options="-1.8"/>
</ajc-test>