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.

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