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

BadFormalsToCalls.java 558B

1234567891011121314151617181920212223242526
  1. import org.aspectj.testing.Tester;
  2. public class BadFormalsToCalls {
  3. static boolean noargsCalled = false;
  4. public static void main(String[] args) {
  5. new BadFormalsToCalls().go();
  6. }
  7. void go() {
  8. new B().noargs();
  9. Tester.check(noargsCalled, "noargs wasn't called");
  10. }
  11. class B {
  12. public void noargs() {
  13. }
  14. }
  15. }
  16. aspect CallsNoArgsAspect {
  17. pointcut noargs(BadFormalsToCalls.B b): call(void noargs());
  18. void around(BadFormalsToCalls.B b): noargs(b) {
  19. proceed(b);
  20. }
  21. }