aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-09-22 15:45:06 +0000
committeracolyer <acolyer>2005-09-22 15:45:06 +0000
commit8a0f59ad18ace56ff59cd9108d18c70358a4f055 (patch)
tree45ca73c9880d6010a1676dd069c8166f161c845a /tests
parent0442d2f26935d7da1a6819eb79c5e7a1c034b229 (diff)
downloadaspectj-8a0f59ad18ace56ff59cd9108d18c70358a4f055.tar.gz
aspectj-8a0f59ad18ace56ff59cd9108d18c70358a4f055.zip
tests and fix for 109283.
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs150/Pr109283.aj27
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml13
3 files changed, 40 insertions, 4 deletions
diff --git a/tests/bugs150/Pr109283.aj b/tests/bugs150/Pr109283.aj
new file mode 100644
index 000000000..62d378e05
--- /dev/null
+++ b/tests/bugs150/Pr109283.aj
@@ -0,0 +1,27 @@
+import java.util.*;
+
+public class Pr109283 {
+
+ enum Foo { Wibble, Wobble, Woo }
+
+ public static void main(String[] args) throws Exception {
+ EnumSet<Foo> set = EnumSet.noneOf(Foo.class);
+ C c2 = Recipient.instanceOf(C.class);
+ }
+
+
+}
+
+class C {}
+
+class Recipient {}
+
+aspect Donor {
+
+ static <E> E Recipient.first(List<E> elements) { return elements.get(0); }
+
+ public static <T> T Recipient.instanceOf(Class<T> aT) throws Exception {
+ return aT.newInstance();
+ }
+
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index c1d78b21b..6c3cb6dac 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -450,6 +450,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("declare parents on a missing type");
}
+ public void testParameterizedGenericMethods() {
+ runTest("parameterized generic methods");
+ }
+
// helper methods.....
public SyntheticRepository createRepos(File cpentry) {
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index de0c97a6b..fb1ce4b0b 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -602,6 +602,11 @@
</compile>
</ajc-test>
+ <ajc-test dir="bugs150" title="parameterized generic methods">
+ <compile files="Pr109283.aj" options="-1.5 -warn:indirectStatic">
+ </compile>
+ </ajc-test>
+
<!-- ============================================================================ -->
<!-- ============================================================================ -->
@@ -3287,7 +3292,7 @@
<ajc-test dir="java5/generics/itds/sharing" title="method itd using type variable from target type - I2">
<compile files="MethodI2.aj" options="-1.5">
- <message kind="error" line="7" text="The method m(List&lt;Integer&gt;) in the type Base&lt;N&gt; is not applicable for the arguments (List&lt;String&gt;)"/>
+ <message kind="error" line="7" text="The method m(List&lt;Integer&gt;) in the type Base&lt;Integer&gt; is not applicable for the arguments (List&lt;String&gt;)"/>
</compile>
</ajc-test>
@@ -3445,8 +3450,8 @@
</ajc-test>
<ajc-test dir="java5/generics/genericaspects/" title="uberaspects - M">
<compile files="GenericAspectM.aj" options="-1.5">
- <message kind="error" line="23" text="The method m0(Integer) in the type GenericAspect&lt;A,B&gt;.SimpleI&lt;L&gt; is not applicable for the arguments (String)"/>
- <message kind="error" line="24" text="The method m1(List&lt;Integer&gt;) in the type GenericAspect&lt;A,B&gt;.SimpleI&lt;L&gt; is not applicable for the arguments (List&lt;String&gt;)"/>
+ <message kind="error" line="23" text="The method m0(Integer) in the type GenericAspect&lt;A,B&gt;.SimpleI&lt;Integer&gt; is not applicable for the arguments (String)"/>
+ <message kind="error" line="24" text="The method m1(List&lt;Integer&gt;) in the type GenericAspect&lt;A,B&gt;.SimpleI&lt;Integer&gt; is not applicable for the arguments (List&lt;String&gt;)"/>
<message kind="error" line="25" text="Type mismatch: cannot convert from String to Integer"/>
<message kind="error" line="26" text="Type mismatch: cannot convert from List&lt;String&gt; to List&lt;Integer&gt;"/>
</compile>
@@ -3458,7 +3463,7 @@
<ajc-test dir="java5/generics/genericaspects/" title="uberaspects - O">
<compile files="GenericAspectO.aj" options="-1.5">
<message kind="error" line="24" text="Cannot make a static reference to the non-static field Bottom.parent"/>
- <message kind="error" line="26" text="The method add(Bottom) in the type List&lt;E&gt; is not applicable for the arguments (Top)"/>
+ <message kind="error" line="26" text="The method add(Bottom) in the type List&lt;Bottom&gt; is not applicable for the arguments (Top)"/>
<message kind="error" line="27" text="Cannot make a static reference to the non-static field Top.children"/>
</compile>
</ajc-test>