aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2005-07-29 13:40:55 +0000
committeraclement <aclement>2005-07-29 13:40:55 +0000
commit14b0f911d8452c172e037d2db88f082b2f0c3bb4 (patch)
tree053a5100237956b7b9808b4b7cda79d571917955 /tests
parent0401dd1abd3417b49640ace6e477c2e0a2ba36e6 (diff)
downloadaspectj-14b0f911d8452c172e037d2db88f082b2f0c3bb4.tar.gz
aspectj-14b0f911d8452c172e037d2db88f082b2f0c3bb4.zip
genericitds: using wildcard '? extends Type' and '? extends <TypeVariable>'. Basically preserves wildcardbindings that are built by eclipse as boundedreferencetypes.
Diffstat (limited to 'tests')
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java13
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml36
2 files changed, 46 insertions, 3 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
index b382f1ff2..e04a08eed 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/GenericsTests.java
@@ -162,10 +162,19 @@ public class GenericsTests extends XMLBasedAjcTestCase {
runTest("itd of static member");
}
- public void testGenericITDComplex() {
- runTest("more complex static member itd");
+ public void testStaticGenericMethodITD() {
+ runTest("static generic method itd");
}
+ // non static
+// public void testNonStaticGenericCtorITD1() {runTest("generic ctor itd - 1");}
+
+ public void testGenericMethodITD1() {runTest("generic method itd - 1");}
+ public void testGenericMethodITD2() {runTest("generic method itd - 2");}
+
+ public void testParameterizedMethodITD1() {runTest("parameterized method itd - 1");}
+ public void testParameterizedMethodITD2() {runTest("parameterized method itd - 2");}
+
// public void testGenericITFSharingTypeVariable() {
// runTest("generic intertype field declaration, sharing type variable");
// }
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index acbdc7465..0861d0ea4 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -2377,7 +2377,7 @@
</run>
</ajc-test>
- <ajc-test dir="java5/generics/itds" title="more complex static member itd">
+ <ajc-test dir="java5/generics/itds" title="static generic method itd">
<compile files="StaticGenericMethodITD.aj" options="-1.5"/>
<run class="StaticGenericMethodITD">
<stderr>
@@ -2386,6 +2386,40 @@
</run>
</ajc-test>
+ <ajc-test dir="java5/generics/itds" title="non static generic ctor itd - 1">
+ <compile files="NonstaticGenericCtorITD1.aj" options="-1.5"/>
+ <run class="NonstaticGenericCtorITD1"/>
+ </ajc-test>
+
+ <ajc-test dir="java5/generics/itds" title="parameterized method itd - 1">
+ <compile files="ParameterizedMethodITD1.aj" options="-1.5"/>
+ <run class="ParameterizedMethodITD1"/>
+ </ajc-test>
+
+ <ajc-test dir="java5/generics/itds" title="parameterized method itd - 2">
+ <compile files="ParameterizedMethodITD2.aj" options="-1.5">
+ <message kind="error" line="9" text="The method simple(List&lt;? extends Number&gt;) in the type X is not applicable for the arguments (List&lt;A&gt;)"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="java5/generics/itds" title="generic method itd - 1">
+ <compile files="GenericMethodITD1.aj" options="-1.5"/>
+ <run class="GenericMethodITD1"/>
+ </ajc-test>
+
+ <ajc-test dir="java5/generics/itds" title="generic method itd - 2">
+ <compile files="GenericMethodITD2.aj" options="-1.5">
+ <!-- this next line might contain a 'bad message' that is fixed in the final 3.1 compiler, I don't think the middle bit should say List&lt;? extends A&gt; - it should probably say List&lt;A&gt; -->
+ <message kind="error" line="9" text="Bound mismatch: The generic method simple(List&lt;? extends E&gt;) of type X is not applicable for the arguments (List&lt;? extends A&gt;) since the type A is not a valid substitute for the bounded parameter &lt;E extends Number&gt;"/>
+ </compile>
+ </ajc-test>
+
+ <ajc-test dir="java5/generics/itds" title="non static generic method itd - 2">
+ <compile files="NonstaticGenericCtorITD2.aj" options="-1.5"/>
+ <run class="NonstaticGenericCtorITD2"/>
+ </ajc-test>
+
+
<ajc-test dir="java5/generics/itds" title="generic intertype field declaration, sharing type variable">
<compile files="FieldITDOnGeneric.aj" options="-1.5"/>
<run class="FieldITDOnGeneric">