aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2005-10-27 18:01:54 +0000
committeraclement <aclement>2005-10-27 18:01:54 +0000
commit8cea30fedf7a74133c67623ec9286ac9578c9a88 (patch)
treefd5446c25cb8c56192a605dca7799346285537b0 /tests
parentae3e83163186bb018b5bad55771e6384fad52802 (diff)
downloadaspectj-8cea30fedf7a74133c67623ec9286ac9578c9a88.tar.gz
aspectj-8cea30fedf7a74133c67623ec9286ac9578c9a88.zip
test and fix for pr113861
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs150/pr113861/Test.java15
-rw-r--r--tests/bugs150/pr113861/TestAspect.java14
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java6
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml12
4 files changed, 42 insertions, 5 deletions
diff --git a/tests/bugs150/pr113861/Test.java b/tests/bugs150/pr113861/Test.java
new file mode 100644
index 000000000..d9316d09b
--- /dev/null
+++ b/tests/bugs150/pr113861/Test.java
@@ -0,0 +1,15 @@
+package com;
+import java.util.*;
+
+public class Test {
+
+ public static void main(String [] argv) {
+ new Test().foo();
+ }
+
+ Set<Integer> intsSet = new HashSet<Integer>();
+
+ public Set<Integer> foo() {
+ return intsSet;
+ }
+}
diff --git a/tests/bugs150/pr113861/TestAspect.java b/tests/bugs150/pr113861/TestAspect.java
new file mode 100644
index 000000000..76ffa5389
--- /dev/null
+++ b/tests/bugs150/pr113861/TestAspect.java
@@ -0,0 +1,14 @@
+package com;
+import java.util.*;
+
+public privileged aspect TestAspect {
+ pointcut gettingMember(Test t) :
+ target(t) &&
+ get(!public Set<Integer> com.*.*) &&
+ !within(TestAspect);
+
+ Set<Integer> around(Test t) : gettingMember(t) {
+ Set s = proceed(t);
+ return s;
+ }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index a47dfca3b..87d96f523 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -51,11 +51,12 @@ 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 testBadDecp_pr110788_1() { runTest("bad generic decp - 1");}
public void testBadDecp_pr110788_2() { runTest("bad generic decp - 2");}
public void testBadDecp_pr110788_3() { runTest("bad generic decp - 3");}
@@ -66,6 +67,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testIncompatibleClassChangeError_pr113630_1() {runTest("IncompatibleClassChangeError - errorscenario");}
public void testIncompatibleClassChangeError_pr113630_2() {runTest("IncompatibleClassChangeError - workingscenario");}
+ public void testFieldGetProblemWithGenericField_pr113861() {runTest("field-get problems with generic field");}
public void testDeclareAnnotationOnNonExistentType_pr99191_1() { runTest("declare annotation on non existent type - 1");}
public void testDeclareAnnotationOnNonExistentType_pr99191_2() { runTest("declare annotation on non existent type - 2");}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index e1adcc731..992cd3808 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -10,7 +10,7 @@
<ajc-test dir="bugs150" title="Problem with constructor ITDs">
<compile files="pr112783.aj" options="-1.5"/>
</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... -->
@@ -26,7 +26,13 @@
<ajc-test dir="bugs150/pr113947/case2" title="maws generic aspect - 2">
<compile files="AbstractListSupport.java" options="-1.5"/><!--,AnotherItem.java,Item.java,LinkedList.java,LinkedListItem.java,ListItem.java,StringList.java" options="-1.5"/-->
</ajc-test>
-
+
+ <ajc-test dir="bugs150/pr113861" title="field-get problems with generic field">
+ <compile files="Test.java,TestAspect.java" options="-1.5"/>
+ <run class="com.Test"/>
+ </ajc-test>
+
+
<ajc-test dir="bugs150/pr99191" title="declare annotation on non existent type - 1">
<compile files="pr99191_1.java" options="-1.5">
<message kind="error" line="4" text="The field 'int C.noSuchField' does not exist"/>
@@ -67,7 +73,7 @@
<message kind="warning" text="void C.&lt;init&gt;(int) - already has an annotation of type Annotation, cannot add a second instance [Xlint:elementAlreadyAnnotated]"/>
</compile>
</ajc-test>
-
+
<ajc-test dir="bugs150/pr113630/case1" title="IncompatibleClassChangeError - errorscenario">
<compile files="Bean.java,BeanTestCase.java,javaBean.java,propertyChanger.java,PropertySupportAspect5.aj" options="-1.5">
<message kind="warning" line="9" text="Failing match because annotation 'javaBean' on type 'Bean' has SOURCE retention. Matching allowed when RetentionPolicy is CLASS or RUNTIME"/>