import org.aspectj.lang.annotation.Around; //import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; //@Aspect public aspect A { static final int MAX = 1000; @Pointcut("call(void C.incI(int)) && args(x) && target(c)") private void CoupureIncI(int x, C c) { } @Around("CoupureIncI(x, c)") public void incIA(int x, C c) { if (c.i + x > MAX) throw new RuntimeException(); } }