First of all, your pointcut does not make sense because a set
pointcut can never be the same as a call
pointcut, so you do not need to exclude it. If you intend to exclude member assignments in constructors, which is what I suppose, you need something like !cflow(execution(*.new(..)))
to exclude control flows within constructors. This is just an example, you may need to specify your exclusion criterion more precisely if it can happen that a constructor calls a method where members are changed, which probably you do not want to exclude etc.
Secondly, I think it is rather ugly to call a bound target v
, I would rather call it target
or t
, if anything. But if you intend to bind the value to v
, not the target, you must use args(v)
anyway.
Now your actual problem: As the Javadoc explicitly says, getField
only works on public fields. So if you need to access a private field, please use getDeclaredField
.