您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. }