From b6464f5bb94272e01fd77fab1c3a508334eefa8a Mon Sep 17 00:00:00 2001 From: aclement Date: Sat, 10 May 2008 00:33:22 +0000 Subject: [PATCH] 227993: annotation value matching support for field annotations. plus hashcode/equals on annotationtypepatterns where it was missing! --- tests/bugs161/pr227993/FieldJP.java | 41 +++++++++++++++++++ .../systemtest/ajc161/Ajc161Tests.java | 1 + .../org/aspectj/systemtest/ajc161/ajc161.xml | 16 ++++++++ 3 files changed, 58 insertions(+) create mode 100644 tests/bugs161/pr227993/FieldJP.java 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 @@ + + + + + + + + + + + + + + + + -- 2.39.5