summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-10-17 08:27:16 +0000
committeraclement <aclement>2005-10-17 08:27:16 +0000
commiteaaf30a16026a8cffadc08b7eab3445c17348620 (patch)
tree97ec6ace320463ecaff7f787095a28db1a5877bb
parent9f651ae391dea61c4a0ba903e33e8fd5655d98b1 (diff)
downloadaspectj-eaaf30a16026a8cffadc08b7eab3445c17348620.tar.gz
aspectj-eaaf30a16026a8cffadc08b7eab3445c17348620.zip
testcode for 110307
-rw-r--r--tests/bugs150/pr110307/Case1.java42
-rw-r--r--tests/bugs150/pr110307/Case2.java48
-rw-r--r--tests/bugs150/pr110307/Case3.java16
-rw-r--r--tests/bugs150/pr110307/Case4.java17
-rw-r--r--tests/bugs150/pr110307/Case5.java18
-rw-r--r--tests/bugs150/pr110307/Case6.java9
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java11
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml48
8 files changed, 203 insertions, 6 deletions
diff --git a/tests/bugs150/pr110307/Case1.java b/tests/bugs150/pr110307/Case1.java
new file mode 100644
index 000000000..b0b3f8d66
--- /dev/null
+++ b/tests/bugs150/pr110307/Case1.java
@@ -0,0 +1,42 @@
+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();
+ }
+
+}
diff --git a/tests/bugs150/pr110307/Case2.java b/tests/bugs150/pr110307/Case2.java
new file mode 100644
index 000000000..f68ed57d7
--- /dev/null
+++ b/tests/bugs150/pr110307/Case2.java
@@ -0,0 +1,48 @@
+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();
+ }
+*/
+
+}
diff --git a/tests/bugs150/pr110307/Case3.java b/tests/bugs150/pr110307/Case3.java
new file mode 100644
index 000000000..3392b051a
--- /dev/null
+++ b/tests/bugs150/pr110307/Case3.java
@@ -0,0 +1,16 @@
+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>;
+}
diff --git a/tests/bugs150/pr110307/Case4.java b/tests/bugs150/pr110307/Case4.java
new file mode 100644
index 000000000..dc67a9552
--- /dev/null
+++ b/tests/bugs150/pr110307/Case4.java
@@ -0,0 +1,17 @@
+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>;
+}
diff --git a/tests/bugs150/pr110307/Case5.java b/tests/bugs150/pr110307/Case5.java
new file mode 100644
index 000000000..ceb3936a6
--- /dev/null
+++ b/tests/bugs150/pr110307/Case5.java
@@ -0,0 +1,18 @@
+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>;
+}
diff --git a/tests/bugs150/pr110307/Case6.java b/tests/bugs150/pr110307/Case6.java
new file mode 100644
index 000000000..89b743051
--- /dev/null
+++ b/tests/bugs150/pr110307/Case6.java
@@ -0,0 +1,9 @@
+import java.util.*;
+
+class A<T> { }
+
+
+aspect X {
+ List<T> A.n() { return null;}
+ List<N> A.m() { return null;}
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index 54b89ff45..28ad9fbaf 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -202,8 +202,8 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
}
- // 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");
}
@@ -482,6 +482,13 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
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");
}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 530ec5f37..47e326dfd 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -2801,7 +2801,7 @@
</stderr>
</run>
</ajc-test>
-
+
<ajc-test dir="java5/suppressedWarnings" title="SuppressAjWarnings raised during matching">
<compile files="SuppressionDuringMatching.aj" options="-1.5">
</compile>
@@ -4954,7 +4954,7 @@
<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&lt;java.lang.Number&gt; onto type C since it already has A&lt;java.lang.String&gt; in its hierarchy"/>
@@ -4977,8 +4977,8 @@
<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"/>
@@ -5025,6 +5025,45 @@
</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&lt;java.lang.String&gt; I.foo() with java.util.List&lt;java.lang.Integer&gt; A.foo() return types don't match"/>
+ <message kind="error" line="15" text="can't override java.util.List&lt;java.lang.String&gt; I.foo() with java.util.List&lt;java.lang.Integer&gt; 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">
@@ -5042,4 +5081,5 @@
<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