diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs150/pr114343/Test.java | 1 | ||||
-rw-r--r-- | tests/bugs150/pr114343/Test1.java | 10 | ||||
-rw-r--r-- | tests/bugs150/pr114343/Test2.java | 11 | ||||
-rw-r--r-- | tests/bugs150/pr114343/TestAspect.aj | 21 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java | 6 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 8 |
6 files changed, 54 insertions, 3 deletions
diff --git a/tests/bugs150/pr114343/Test.java b/tests/bugs150/pr114343/Test.java new file mode 100644 index 000000000..1a8a201f6 --- /dev/null +++ b/tests/bugs150/pr114343/Test.java @@ -0,0 +1 @@ +public class Test {} diff --git a/tests/bugs150/pr114343/Test1.java b/tests/bugs150/pr114343/Test1.java new file mode 100644 index 000000000..3bd2195a9 --- /dev/null +++ b/tests/bugs150/pr114343/Test1.java @@ -0,0 +1,10 @@ +import java.util.*; + +public class Test1 extends Test { + Set<Integer> intsSet; + + public Set<Integer> foo() { + return intsSet; + } +} + diff --git a/tests/bugs150/pr114343/Test2.java b/tests/bugs150/pr114343/Test2.java new file mode 100644 index 000000000..983fc3819 --- /dev/null +++ b/tests/bugs150/pr114343/Test2.java @@ -0,0 +1,11 @@ +import java.util.*; + +public class Test2 extends Test { + Set<Double> doubSet; + + + public Set<Double> foo() { + return doubSet; + } +} + diff --git a/tests/bugs150/pr114343/TestAspect.aj b/tests/bugs150/pr114343/TestAspect.aj new file mode 100644 index 000000000..b0dcf02f3 --- /dev/null +++ b/tests/bugs150/pr114343/TestAspect.aj @@ -0,0 +1,21 @@ +import java.util.*; + +public privileged aspect TestAspect { + + pointcut p(Test t): + target(t) && + get(!public Set<Number+> *Set) && + !within(TestAspect); + + Set around(Test t):p(t) { + Set s = proceed(t); + return s; + } + + public static void main(String []argv) { + + Set<Integer> si = new Test1().foo(); + Set<Double> sd = new Test2().foo(); + } + +} diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 87d96f523..3ae36e93f 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -51,11 +51,11 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testITDCtor_pr112783() { runTest("Problem with constructor ITDs");} */ - public void testUnboundFormal_pr112027() { runTest("unexpected error unboundFormalInPC");} - public void testCCEGenerics_pr113445() { runTest("Generics ClassCastException");} + public void testUnboundFormal_pr112027() { runTest("unexpected error unboundFormalInPC");} + public void testCCEGenerics_pr113445() { runTest("Generics ClassCastException");} public void testMatthewsAspect_pr113947_1() { runTest("maws generic aspect - 1");} public void testMatthewsAspect_pr113947_2() { runTest("maws generic aspect - 2");} - + public void testFieldGet_pr114343() { runTest("field-get, generics and around advice");} public void testBadDecp_pr110788_1() { runTest("bad generic decp - 1");} public void testBadDecp_pr110788_2() { runTest("bad generic decp - 2");} diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index a5679fb30..45096e496 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -16,6 +16,14 @@ </compile> </ajc-test> + <ajc-test dir="bugs150/pr114343" title="field-get, generics and around advice"> + <compile files="Test.java,Test1.java,Test2.java,TestAspect.aj" options="-1.5"> + <message kind="warning" line="7" text="unchecked conversion when advice applied at shadow field-get(java.util.Set Test1.intsSet), expected java.util.Set<java.lang.Integer> but advice uses java.util.Set"/> + <message kind="warning" line="8" text="unchecked conversion when advice applied at shadow field-get(java.util.Set Test2.doubSet), expected java.util.Set<java.lang.Double> but advice uses java.util.Set"/> + </compile> + <run class="TestAspect"/> + </ajc-test> + <ajc-test dir="bugs150/pr113947/case1" title="maws generic aspect - 1"> <compile files="AbstractListSupport.java,AnotherItem.java,Item.java,LinkedList.java,LinkedListItem.java,ListItem.java,StringList.java" options="-1.5"> <!-- the 'static ref' messages are a bit poor and ought to be eliminated... --> |