diff options
-rw-r--r-- | tests/bugs153/pr150671.aj | 16 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java | 2 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc153/ajc153.xml | 7 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java | 2 |
4 files changed, 26 insertions, 1 deletions
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 @@ </stdout> </run> </ajc-test> + + <ajc-test dir="bugs153" title="match volatile field"> + <compile files="pr150671.aj" options="-Xset:activateLightweightDelegates=false"> + <message kind="error" line="7" text="Changing state"/> + <message kind="error" line="8" text="test"/> + </compile> + </ajc-test> </suite>
\ 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() { |