aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2008-05-10 00:33:22 +0000
committeraclement <aclement>2008-05-10 00:33:22 +0000
commitb6464f5bb94272e01fd77fab1c3a508334eefa8a (patch)
treeab26ece51886aea1360a88b48c8baa9f9c8934d8 /tests
parent78e2c20178e245e7dac74b9646841beaa376d0d5 (diff)
downloadaspectj-b6464f5bb94272e01fd77fab1c3a508334eefa8a.tar.gz
aspectj-b6464f5bb94272e01fd77fab1c3a508334eefa8a.zip
227993: annotation value matching support for field annotations. plus hashcode/equals on annotationtypepatterns where it was missing!
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs161/pr227993/FieldJP.java41
-rw-r--r--tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java1
-rw-r--r--tests/src/org/aspectj/systemtest/ajc161/ajc161.xml16
3 files changed, 58 insertions, 0 deletions
diff --git a/tests/bugs161/pr227993/FieldJP.java b/tests/bugs161/pr227993/FieldJP.java
new file mode 100644
index 000000000..e36de3531
--- /dev/null
+++ b/tests/bugs161/pr227993/FieldJP.java
@@ -0,0 +1,41 @@
+
+import java.lang.annotation.*;
+
+enum Store {YES,NO;}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface SearchableProperty { Store store(); }
+
+public class FieldJP {
+ @SearchableProperty(store=Store.YES)
+ public static int fieldOne;
+
+ @SearchableProperty(store=Store.NO)
+ public static int fieldTwo;
+
+ public static int fieldThree;
+
+ public static void main(String[] args) {
+ System.err.println("fone="+fieldOne);
+ System.err.println("ftwo="+fieldTwo);
+ System.err.println("fthr="+fieldThree);
+ fieldOne = 5;
+ fieldTwo = 6;
+ fieldThree = 7;
+ }
+}
+
+aspect X {
+ before(): get(@SearchableProperty(store=Store.YES) * *) {
+ System.err.println("get of YES field");
+ }
+ before(): get(@SearchableProperty(store=Store.NO) * *) {
+ System.err.println("get of NO field");
+ }
+ before(): set(@SearchableProperty(store=Store.YES) * *) {
+ System.err.println("set of YES field");
+ }
+ before(): set(@SearchableProperty(store=Store.NO) * *) {
+ System.err.println("set of NO field");
+ }
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java b/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
index f9346d8b3..def12d951 100644
--- a/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc161/Ajc161Tests.java
@@ -19,6 +19,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
public class Ajc161Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// AspectJ1.6.1
+ public void testFieldJoinpointsAndAnnotationValues_pr227993() { runTest("field jp anno value"); }
public void testGenericsBoundsDecp_pr231187() { runTest("generics bounds decp"); }
public void testGenericsBoundsDecp_pr231187_2() { runTest("generics bounds decp - 2"); }
public void testLtwInheritedCflow_pr230134() { runTest("ltw inherited cflow"); }
diff --git a/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml b/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml
index 9b631266b..4e9932df4 100644
--- a/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml
+++ b/tests/src/org/aspectj/systemtest/ajc161/ajc161.xml
@@ -3,6 +3,22 @@
<!-- AspectJ v1.6.1 Tests -->
<suite>
+
+ <ajc-test dir="bugs161/pr227993" title="field jp anno value">
+ <compile files="FieldJP.java" options="-1.5"/>
+ <run class="FieldJP">
+ <stderr>
+ <line text="get of YES field"/>
+ <line text="fone=0"/>
+ <line text="get of NO field"/>
+ <line text="ftwo=0"/>
+ <line text="fthr=0"/>
+ <line text="set of YES field"/>
+ <line text="set of NO field"/>
+ </stderr>
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs161/pr231187x" title="generics bounds decp">
<compile files="Cement.java ConcreteClass.java SuperClass.java SuperClassAspect.aj WetCement.java Main.java" options="-1.5"/>
<run class="concrete.Main">