}
aspect ExtendProduct {
- Link<T> AssociationSource._target = null;
+ Link<Q> AssociationSource<Q>._target = null;
- public Link<T> AssociationSource.getTarget() {
+ public Link<Q> AssociationSource<Q>.getTarget() {
return _target;
}
- public void AssociationSource.setTarget(Link<T> _target) {
+ public void AssociationSource<Q>.setTarget(Link<Q> _target) {
this._target = _target;
}
--- /dev/null
+import java.lang.annotation.*;
+import java.lang.ref.*;
+import java.util.*;
+
+public class Case7 {
+
+ public static void main(String []argv) {
+ String s = "hello";
+ Integer i = 35;
+ List l = new ArrayList();
+ List<String> ls = new ArrayList<String>();
+ List<Number> ln = new ArrayList<Number>();
+ List<List> ll = new ArrayList<List>();
+
+ A a = new A();
+ a.setN(ls,s);
+ String s2 = a.getN(ls);
+ System.err.println("in="+s+" out="+s2);
+
+ B b = new B();
+ b.setN(ln,i);
+ System.err.println("in="+i+" out="+b.getN(ln));
+
+ C c = new C();
+ c.setN(ll,l);
+ List l2 = c.getN(ll);
+ System.err.println("in="+l+" out="+l2);
+
+ }
+
+}
+
+
+interface I<N> {
+ N getN(List<N> ns);
+
+ void setN(List<N> ns,N n);
+}
+
+aspect X {
+ Q I<Q>.value;
+
+ public P I<P>.getN(List<P> ps) {
+ return value;
+ }
+
+ public void I<Q>.setN(List<Q> ns,N n) {
+ this.value = n;
+ }
+
+ declare parents : A implements I<String>;
+ declare parents : B implements I<Number>;
+ declare parents : C implements I<List>;
+}
+
+
+class A { }
+class B { }
+class C { }
public void testCunningDeclareParents_pr92311() { runTest("cunning declare parents");}
public void testGenericITDsAndAbstractMethodError_pr102357() { runTest("generic itds and abstract method error");}
*/
+
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");}
runTest("parameterized generic methods");
}
-// public void testCantProvideDefaultImplViaITD_pr110307_1() {runTest("Cant provide default implementation via ITD - 1");}
-// public void testCantProvideDefaultImplViaITD_pr110307_2() {runTest("Cant provide default implementation via ITD - 2");}
-// public void testCantProvideDefaultImplViaITD_pr110307_3() {runTest("Cant provide default implementation via ITD - 3");}
+ public void testCantProvideDefaultImplViaITD_pr110307_1() {runTest("Cant provide default implementation via ITD - 1");}
+ public void testCantProvideDefaultImplViaITD_pr110307_2() {runTest("Cant provide default implementation via ITD - 2");}
+ public void testCantProvideDefaultImplViaITD_pr110307_3() {runTest("Cant provide default implementation via ITD - 3");}
public void testCantProvideDefaultImplViaITD_pr110307_4() {runTest("Cant provide default implementation via ITD - 4");}
-// public void testCantProvideDefaultImplViaITD_pr110307_5() {runTest("Cant provide default implementation via ITD - 5");}
-// public void testCantProvideDefaultImplViaITD_pr110307_6() {runTest("Cant provide default implementation via ITD - 6");}
+ public void testCantProvideDefaultImplViaITD_pr110307_5() {runTest("Cant provide default implementation via ITD - 5");}
+
+ // Needs a change in the compiler so that getType() can be overridden in the intertype scope - thats
+ // where we can police whether a type variable has been used without being specified appropriately.
+ //public void testCantProvideDefaultImplViaITD_pr110307_6() {runTest("Cant provide default implementation via ITD - 6");}
+
+ public void testCantProvideDefaultImplViaITD_pr110307_7() {runTest("Cant provide default implementation via ITD - 7");}
public void testCallJoinPointsInAnonymousInnerClasses() {
runTest("call join points in anonymous inner classes");
<ajc-test dir="bugs150/pr110307" title="Cant provide default implementation via ITD - 6">
<compile files="Case6.java" options="-1.5">
- <!--message kind="error" line="8" text="N cannot be resolved to a type"/-->
+ <message kind="error" line="8" text="N cannot be resolved to a type"/>
<!--message kind="error" line="7" text="T cannot be resolved to a type"/-->
</compile>
</ajc-test>
-
+ <ajc-test dir="bugs150/pr110307" title="Cant provide default implementation via ITD - 7">
+ <compile files="Case7.java" options="-1.5"/>
+ <run class="Case7">
+ <stderr>
+ <line text="in=hello out=hello"/>
+ <line text="in=35 out=35"/>
+ <line text="in=[] out=[]"/>
+ </stderr>
+ </run>
+ </ajc-test>
<!-- generic ITDs -->