--- /dev/null
+interface A<T> {}
+
+interface B<T> extends A<T> {}
+
+class C implements A<String> {}
+
+class D extends C {}
+
+aspect X {
+ declare parents: D implements B<Number>; // Can't do it, C implement A<String>
+}
--- /dev/null
+interface A<T> {}
+
+class C implements A<String> {}
+
+class D extends C {}
+
+aspect X {
+ declare parents: D implements A<Number>; // Can't do it, C implements A<String>
+}
--- /dev/null
+interface A<T> {}
+
+interface B<T> extends A<T> {}
+
+class C implements A<String> {}
+
+class D extends C {}
+
+aspect X {
+ declare parents: D implements B<String>; // Can do it, parameterizations are compatible
+}
--- /dev/null
+interface A<T> {}
+
+interface B<T> extends A<T> {}
+
+class C implements A<String> {}
+
+class D extends C {}
+
+aspect X {
+ declare parents: D implements B<String>; // Can do it, parameterizations are compatible
+}
import org.aspectj.testing.XMLBasedAjcTestCase;
import org.aspectj.util.LangUtil;
-/**
- * These are tests that will run on Java 1.4 and use the old harness format for test specification.
- */
public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public static Test suite() {
protected File getSpecFile() {
return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
}
+
+ public void testBadDecp_pr110788_1() { runTest("bad generic decp - 1");}
+ public void testBadDecp_pr110788_2() { runTest("bad generic decp - 2");}
+ public void testBadDecp_pr110788_3() { runTest("bad generic decp - 3");}
+ public void testBadDecp_pr110788_4() { runTest("bad generic decp - 4");}
public void test_typeProcessingOrderWhenDeclareParents() {
runTest("Order of types passed to compiler determines weaving behavior");
runTest("overriding/polymorphism error on interface method introduction");
}
- /**
- * IfPointcut.findResidueInternal() was modified to make this test complete in a short amount
- * of time - if you see it hanging, someone has messed with the optimization.
- */
+
+ // IfPointcut.findResidueInternal() was modified to make this test complete in a short amount
+ // of time - if you see it hanging, someone has messed with the optimization.
public void testIfEvaluationExplosion_pr94086() {
runTest("Exploding compile time with if() statements in pointcut");
}
<compile files="pr109728.java" options="-1.5"/>
</ajc-test>
+ <ajc-test dir="bugs150/pr110788" title="bad generic decp - 1">
+ <compile files="Case1.java" options="-1.5">
+ <message kind="error" line="10" text="Cannot declare parent B<java.lang.Number> onto type C since it already has A<java.lang.String> in its hierarchy"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr110788" title="bad generic decp - 2">
+ <compile files="Case2.java" options="-1.5">
+ <message kind="error" line="8" text="Cannot declare parent A<java.lang.Number> onto type C since it already has A<java.lang.String> in its hierarchy"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr110788" title="bad generic decp - 3">
+ <compile files="Case3.java" options="-1.5"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr110788" title="bad generic decp - 4">
+ <compile files="Case4.java" options="-1.5"/>
+ </ajc-test>
</suite>
\ No newline at end of file