--- /dev/null
+import java.lang.annotation.*;
+import java.lang.ref.*;
+
+class Product{}
+class ProductType{}
+
+interface AssociationSource<T> {
+
+ Link<T> getTarget();
+
+ void setTarget(Link<T> _target);
+
+}
+aspect ExtendProduct {
+ Link<T> AssociationSource._target = null;
+
+ public Link<T> AssociationSource.getTarget() {
+ return _target;
+ }
+
+ public void AssociationSource.setTarget(Link<T> _target) {
+ this._target = _target;
+ }
+
+ declare parents : ProductType implements AssociationSource<Product>;
+ declare parents : Product implements AssociationSource<Branch>;
+ declare parents : Branch implements AssociationSource<Revision>;
+}
+
+class Link<T> extends SoftReference {
+
+ @SuppressWarnings("unchecked")
+ Link(List<T> endPoints) {
+ super(endPoints);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<T> getEndPoints() {
+ return (List<T>)get();
+ }
+
+}
--- /dev/null
+import java.util.*;
+import java.lang.annotation.*;
+import java.lang.ref.*;
+
+class Product {}
+class ProductType{}
+class Branch {}
+class Revision {}
+
+interface AssociationSource<T> {
+
+ Link<T> getTarget();
+
+ void setTarget(Link<T> _target);
+
+}
+aspect ExtendProduct {
+ Link<T> AssociationSource<T>._target = null;
+
+ public Link<T> AssociationSource<T>.getTarget() {
+ return _target;
+ }
+
+ public void AssociationSource<T>.setTarget(Link<T> _target) {
+ this._target = _target;
+ }
+
+ declare parents : ProductType implements AssociationSource<Product>;
+/*
+ declare parents : Product implements AssociationSource<Branch>;
+ declare parents : Branch implements AssociationSource<Revision>;
+*/
+}
+
+class Link<T> {//extends SoftReference {
+
+/* @SuppressWarnings("unchecked")
+ Link(List<T> endPoints) {
+ super(endPoints);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<T> getEndPoints() {
+ return (List<T>)get();
+ }
+*/
+
+}
--- /dev/null
+import java.util.*;
+import java.lang.annotation.*;
+import java.lang.ref.*;
+
+interface I<T> {
+}
+
+class A {
+}
+
+aspect X {
+
+ List<T> I<T>.foo() { return null; } // should be ok...
+
+ declare parents: A implements I<String>;
+}
--- /dev/null
+import java.util.*;
+import java.lang.annotation.*;
+import java.lang.ref.*;
+
+interface I<T> {
+}
+
+class A {
+ List<String> foo() { return null; }
+}
+
+aspect X {
+
+ List<T> I<T>.foo() { return null; } // should be ok - A implements I<String>
+
+ declare parents: A implements I<String>;
+}
--- /dev/null
+import java.util.*;
+import java.lang.annotation.*;
+import java.lang.ref.*;
+
+interface I<T> {
+}
+
+class A {
+ // error, not compatible with List<String> from supertype
+ List<Integer> foo() { return null; }
+}
+
+aspect X {
+
+ List<T> I<T>.foo() { return null; }
+
+ declare parents: A implements I<String>;
+}
--- /dev/null
+import java.util.*;
+
+class A<T> { }
+
+
+aspect X {
+ List<T> A.n() { return null;}
+ List<N> A.m() { return null;}
+}
}
- // 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");
}
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_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 testCallJoinPointsInAnonymousInnerClasses() {
runTest("call join points in anonymous inner classes");
}
</stderr>
</run>
</ajc-test>
-
+
<ajc-test dir="java5/suppressedWarnings" title="SuppressAjWarnings raised during matching">
<compile files="SuppressionDuringMatching.aj" options="-1.5">
</compile>
<ajc-test dir="bugs150" title="Unable to build shadows">
<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"/>
<ajc-test dir="bugs150/pr110927" title="cant create signature attribute">
<compile files="Case1.java" options="-1.5"/>
- </ajc-test>
-
+ </ajc-test>
+
<ajc-test dir="bugs150/pr72834" title="broken dispatch">
<compile files="Trouble.java">
<message kind="error" line="7" text="package visible abstract inter-type declarations are not allowed"/>
</run>
</ajc-test>
+ <ajc-test dir="bugs150/pr110307" title="Cant provide default implementation via ITD - 1">
+ <compile files="Case1.java" options="-1.5">
+ <message kind="warning" line="27" text="no match for this type name: Branch [Xlint:invalidAbsoluteTypeName]"/>
+ <message kind="error" line="26" text="can't bind type name 'Branch'"/>
+ <message kind="error" line="27" text="can't bind type name 'Revision'"/>
+ <message kind="error" line="33" text="List cannot be resolved to a type"/>
+ <message kind="error" line="38" text="List cannot be resolved to a type"/>
+ <message kind="error" line="39" text="List cannot be resolved to a type"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr110307" title="Cant provide default implementation via ITD - 2">
+ <compile files="Case2.java" options="-1.5"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr110307" title="Cant provide default implementation via ITD - 3">
+ <compile files="Case3.java" options="-1.5"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr110307" title="Cant provide default implementation via ITD - 4">
+ <compile files="Case4.java" options="-1.5"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs150/pr110307" title="Cant provide default implementation via ITD - 5">
+ <compile files="Case5.java" options="-1.5">
+ <!-- might possibly need more diagnostics in this case to explain what has happened -->
+ <message kind="error" line="10" text="can't override java.util.List<java.lang.String> I.foo() with java.util.List<java.lang.Integer> A.foo() return types don't match"/>
+ <message kind="error" line="15" text="can't override java.util.List<java.lang.String> I.foo() with java.util.List<java.lang.Integer> A.foo() return types don't match"/>
+ </compile>
+ </ajc-test>
+
+ <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="7" text="T cannot be resolved to a type"/-->
+ </compile>
+ </ajc-test>
+
+
<!-- generic ITDs -->
<ajc-test dir="java5/generics/itds/design" title="generic itds - design A">
<ajc-test dir="java5/generics/itds/design" title="generic itds - design D">
<compile files="DesignD.java" options="-1.5,-XnoWeave"/>
</ajc-test>
+
</suite>
\ No newline at end of file