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

123456789101112131415161718192021222324252627282930
  1. public class Pr114054 {
  2. public static boolean passed;
  3. public static void main(String[] args) {
  4. SampleSeries me = new SampleSeries();
  5. me.okSeries();
  6. me.open();
  7. me.close();
  8. if (!passed) {
  9. throw new Error("failed to advise...");
  10. }
  11. }
  12. static class SampleSeries {
  13. void open() {}
  14. void close() {}
  15. void okSeries() {open(); close();}
  16. }
  17. static aspect AAAA
  18. // comment this out, and !call(...) works
  19. pertarget(tracked())
  20. {
  21. protected final pointcut tracked() :
  22. call(void SampleSeries.*())
  23. // comment this out, and pertarget works...
  24. && !call(void SampleSeries.*Series())
  25. ;
  26. before() : tracked() {
  27. Pr114054.passed = true;
  28. }
  29. }
  30. }