[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[aspectj-users] declare error involving volatile field
|
- From: "Arjun Singh" <aasingh@xxxxxxxxx>
- Date: Thu, 13 Jul 2006 09:04:51 -0700
- Delivered-to: aspectj-users@eclipse.org
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=LtP6b2o795HeBQERMnsYVbQ+50Kw0EYJOIaIHgzzYOXwTa2oo0G6dNeumct11Dm/JqeEMopfO7ct48zxllXwyY+KPQLMusuycYUCtOQurDth/zjsuqAQoHLL7Rzv64YBKW4szFgrYgiQ06TD9QlJLQ5eSbcN/NyGhXOjrZqXzc4=
Hello,
I have a situation that is similar to the following example:
class A {
private volatile int state;
public void foo() {
state = 0;
}
}
aspect FSM {
declare error: set(* A.state) && !within(FSM): "Changing state
outside aspect";
}
The modification to the state variable in method foo() does not result
in a compilation error. However, if I change the type of the state
variable to just int (rather than volatile int), a compilation error
is produced as intended.
As far as I know, it should be possible to use declare error with a
volatile int, as shown above. Am I mistaken, or am I doing something
wrong? I am using AJDT 1.4 with Eclipse 3.2.
Thanks,
Arjun