1234567891011121314151617181920212223242526272829 |
- class WarningSample {
-
- public void method() {}
- public void anotherMethod() {
- this.method();
- }
-
- }
-
- aspect WarningAspect {
-
- pointcut illegalCall(): call(* WarningSample.method())
- && within(WarningSample);
-
- // the same thing happens with declare error
- declare warning: illegalCall() : "Hey, don't " +
- "do that, that is not nice. You should do something else";
-
- public void e1() {}
- declare warning: execution(* e1(..)): "hello " + /* comment */ "world"
-
- public void e2() {}
- declare warning: execution(* e2(..)): "hello " /* comment + "world";
-
- public void e3() {}
- declare warning: execution(* e3(..)): "hello " + // commenthere
-
- }
|