You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Warnings.java 1.4KB

1234567891011121314151617181920212223242526
  1. package p;
  2. aspect Checker {
  3. declare warning: execution(* A.m(..)): "joinpoint location is {joinpoint.sourcelocation.sourcefile}:{joinpoint.sourcelocation.line}";
  4. declare warning: execution(* A.m(..)): "joinpoint is {joinpoint}";
  5. declare warning: execution(* A.m(..)): "joinpoint kind is {joinpoint.kind}";
  6. declare warning: execution(* A.m(..)): "joinpoint kind is '{joinpoint.kind}'";
  7. declare warning: execution(* A.m(..)): "joinpoint line is '{joinpoint.sourcelocation.line}'";
  8. declare warning: execution(* A.m(..)): "joinpoint signature is {joinpoint.signature}";
  9. declare warning: get(int *) && within(A): "joinpoint signature is {joinpoint.signature}";
  10. declare warning: execution(* A.m(..)): "joinpoint declaring type is {joinpoint.signature.declaringType}";
  11. declare warning: execution(* A.m(..)): "advice sourcelocation is {advice.sourcelocation.sourcefile}:{advice.sourcelocation.line}";
  12. declare warning: get(int *): "aspect is {advice.aspecttype}";
  13. declare warning: get(int *): "signature name for field is {joinpoint.signature.name}";
  14. declare warning: execution(* A.m(..)): "signature name for method is {joinpoint.signature.name}";
  15. declare warning: execution(* A.m(..)): "\\{}wibble";
  16. declare warning: execution(* A.m(..)): "{}foobar";
  17. declare warning: execution(* A.m(..)): "test {advice.sourcelocation.line}\\{}{joinpoint.sourcelocation.line}";
  18. }
  19. class A {
  20. int i;
  21. public void m() {
  22. System.out.println(i);
  23. }
  24. }