Community
Participate
Working Groups
Currently, aspect instance variable can't be used directly inside an if() pointcut. For example, it is currently an error ("Cannot make a static reference to the non-static field") to do something like: public aspect InstanceVariableIfCheck { private boolean enabled; before() : execution(* *(..)) && if(enabled) { ... } } That forces developers to do either: before() : execution(* *(..)) && if(InstanceVariableIfCheck.aspectOf().enabled) { ... } or before() : execution(* *(..)) { if(enabled) { ... } } The second style can be problematic for a newbie who may forget to call proceed() even when bypassing the advice logic.