From 357bbe9eeb34748f7c8c2ff85049230db2adbbf2 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 25 Jul 2006 07:46:13 +0000 Subject: [PATCH] test and fix for Bug 150671: declare error on set of volatile field does not work --- tests/bugs153/pr150671.aj | 16 ++++++++++++++++ .../aspectj/systemtest/ajc153/Ajc153Tests.java | 2 ++ .../src/org/aspectj/systemtest/ajc153/ajc153.xml | 7 +++++++ .../org/aspectj/weaver/ResolvedMemberImpl.java | 2 +- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 tests/bugs153/pr150671.aj diff --git a/tests/bugs153/pr150671.aj b/tests/bugs153/pr150671.aj new file mode 100644 index 000000000..86f495bc3 --- /dev/null +++ b/tests/bugs153/pr150671.aj @@ -0,0 +1,16 @@ +class C { + + private volatile int state; + private int test; + + public void foo() { + state = 0; + test = 0; + } + +} + +aspect FSM { + declare error: set(* C.state): "Changing state"; + declare error: set(* C.test): "test"; +} diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java index 4878bb045..111800bef 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java @@ -46,6 +46,8 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testCantFindType_pr149322_02() {runTest("can't find type on interface call 2");} public void testCantFindType_pr149322_03() {runTest("can't find type on interface call 3");} + public void testMatchVolatileField_pr150671() {runTest("match volatile field");}; + ///////////////////////////////////////// public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Ajc153Tests.class); diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml index a8b4c6034..94026f753 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml +++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml @@ -237,5 +237,12 @@ + + + + + + + \ No newline at end of file diff --git a/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java b/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java index 71eb910cb..f5bd991c7 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java +++ b/weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java @@ -321,7 +321,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno } public boolean isBridgeMethod() { - return (modifiers & Constants.ACC_BRIDGE)!=0; + return (modifiers & Constants.ACC_BRIDGE)!=0 && getKind().equals(METHOD); } public boolean isVarargsMethod() { -- 2.39.5