Project: AspectJ
Bug 150671 declare error on set of volatile field does not work
Reported: 2006-07-14 12:19:01 | Status: resolved fixed

When an aspect has a declare error statement involving a pointcut that captures the setting of a volatile field, a compilation error is not produced. This bug can be reproduced as follows. Consider the following class: class A { private volatile int state; public void foo() { state = 0; } } Now consider this aspect: aspect FSM { declare error: set(* A.state): "Changing state"; } The setting of the state field in method foo() does not result in a compilation error as expected. I originally noticed this bug when using AJDT 1.4 with Eclipse 3.2. However this has been reproduced and confirmed with the aspectj 1.5.2 compiler.

Files changed in fix:
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java weaver/src/org/aspectj/weaver/ResolvedMemberImpl.java