--- /dev/null
+class C implements II {}
+
+class D {
+ public static void m() {
+ C c = new C();
+ E1 e1 = new E1();
+ E2 e2 = new E2();
+ c.foo(e1,e2.getClass());
+ }
+}
+
+class E1 implements I1 {}
+class E2 implements I2 {}
import junit.framework.Test;
+import org.aspectj.apache.bcel.classfile.JavaClass;
+import org.aspectj.apache.bcel.classfile.Method;
+import org.aspectj.systemtest.ajc150.GenericsTests;
import org.aspectj.testing.XMLBasedAjcTestCase;
/**
*/
public class Ajc1611Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ // error without the fix:
+ // Second.java:8:0::0 Bound mismatch: The generic method foo(R, Class<T>) of type II is not applicable for the arguments (E1,
+ // Class<capture#1-of ? extends E2>). The inferred type capture#1-of ? extends E2 is not a valid substitute for the bounded
+ // parameter <R extends I1>
+ public void testBoundsChecking_pr336880() {
+ runTest("bounds check confusion");
+ }
+
+ public void testClashingItds_pr336774() {
+ runTest("clashing itds");
+ }
+
+ public void testBadGenericSigAttribute_pr336745() {
+ runTest("incorrect signature");
+ JavaClass jc = GenericsTests.getClass(ajc, "C");
+ assertNotNull(jc);
+ Method m = getMethod(jc, "m");
+ Method mitd = getMethod(jc, "mitd");
+ assertEquals("<T::LI;>(TT;)V", m.getGenericSignature());
+ assertEquals("<T::LI;>(TT;)V", mitd.getGenericSignature());
+ }
+
+ private Method getMethod(JavaClass jc, String name) {
+ for (Method m : jc.getMethods()) {
+ if (m.getName().equals(name)) {
+ return m;
+ }
+ }
+ return null;
+ }
+
public void testESJP_336471() {
runTest("esjp");
}
<suite>
+ <ajc-test dir="bugs1611/pr336880" title="bounds check confusion">
+ <compile files="First.java" options="-1.5"/>
+ <compile files="Second.java" aspectpath="." options="-1.5"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs1611/pr336774" title="clashing itds">
+ <compile files="First.java" options="-1.5"/>
+ <compile files="Test.java" aspectpath="." options="-1.5"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs1611/pr336745" title="incorrect signature">
+ <compile files="Foo.aj" options="-1.5"/>
+ </ajc-test>
+
<ajc-test dir="bugs1611/pr336471" title="esjp">
<compile files="Tester.aj" options="-1.5 -Xset:targetRuntime1_6_10=true"/>
<run class="Tester">