diff options
author | acolyer <acolyer> | 2005-09-22 15:45:06 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-09-22 15:45:06 +0000 |
commit | 8a0f59ad18ace56ff59cd9108d18c70358a4f055 (patch) | |
tree | 45ca73c9880d6010a1676dd069c8166f161c845a /tests | |
parent | 0442d2f26935d7da1a6819eb79c5e7a1c034b229 (diff) | |
download | aspectj-8a0f59ad18ace56ff59cd9108d18c70358a4f055.tar.gz aspectj-8a0f59ad18ace56ff59cd9108d18c70358a4f055.zip |
tests and fix for 109283.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs150/Pr109283.aj | 27 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 13 |
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<Integer>) in the type Base<N> is not applicable for the arguments (List<String>)"/> + <message kind="error" line="7" text="The method m(List<Integer>) in the type Base<Integer> is not applicable for the arguments (List<String>)"/> </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<A,B>.SimpleI<L> is not applicable for the arguments (String)"/> - <message kind="error" line="24" text="The method m1(List<Integer>) in the type GenericAspect<A,B>.SimpleI<L> is not applicable for the arguments (List<String>)"/> + <message kind="error" line="23" text="The method m0(Integer) in the type GenericAspect<A,B>.SimpleI<Integer> is not applicable for the arguments (String)"/> + <message kind="error" line="24" text="The method m1(List<Integer>) in the type GenericAspect<A,B>.SimpleI<Integer> is not applicable for the arguments (List<String>)"/> <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<String> to List<Integer>"/> </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<E> is not applicable for the arguments (Top)"/> + <message kind="error" line="26" text="The method add(Bottom) in the type List<Bottom> 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> |