Okay, guys, tell me what I'm doing wrong.
I have:
public class MandatoryParamFixture {
public void withMandatoryParam(@Mandatory String param) { }
}
with:
public aspect MandatoryParamAspect {
pointcut executeArg1(String arg) : (execution(new(@Mandatory
Object+, ..)) || execution(* *(@Mandatory Object+, ..)) ) &&
args(arg, ..);
before(Object arg): executeArg1(arg) { if (arg == null) {
throw new IllegalArgumentException("Mandatory!");
}
}
}
You get the idea? However, the executeArg1 pointcut doesn't match the
method in my fixture.
I've obviously misunderstood this pointcut pattern, can anyone set me
straight?
Thanks
Dan