mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-13 15:45:38 +02:00
proactive bug fix (bug not entered) making a short example
in semantics guide more meaningful
This commit is contained in:
parent
a9fbc05e94
commit
b242e1b573
@ -621,13 +621,13 @@
|
||||
All set join points are treated as having one argument, the value the
|
||||
field is being set to, so at a set join point, that value can be
|
||||
accessed with an <literal>args</literal> pointcut. So an aspect
|
||||
guarding an integer variable x declared in type T might be written as
|
||||
guarding a static integer variable x declared in type T might be written as
|
||||
</para>
|
||||
|
||||
<programlisting><![CDATA[
|
||||
aspect GuardedX {
|
||||
static final int MAX_CHANGE = 100;
|
||||
before(int newval): set(int T.x) && args(newval) {
|
||||
before(int newval): set(static int T.x) && args(newval) {
|
||||
if (Math.abs(newval - T.x) > MAX_CHANGE)
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user