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

EachObjectNoThis.java 442B

1234567891011121314151617181920212223
  1. import org.aspectj.testing.Tester;
  2. public class EachObjectNoThis {
  3. public static void main(String[] args) {
  4. new C().foo();
  5. }
  6. }
  7. class C {
  8. public void foo() {
  9. }
  10. }
  11. aspect A /*of eachobject(!instanceof(Object))*/ {
  12. {
  13. // This doesn't appy
  14. //Tester.checkFailed("this aspect shouldn't exist");
  15. }
  16. before(): !target(Object) && call(* *(..)) {
  17. Tester.checkFailed("this aspect shouldn't exist");
  18. }
  19. }