summaryrefslogtreecommitdiffstats
path: root/tests/errors/BadFormalsToCalls.java
blob: 17559bbe0d7419b782e58e13dd6addb911e3c67f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import org.aspectj.testing.Tester;
public class BadFormalsToCalls {

    static boolean noargsCalled = false;
    
    public static void main(String[] args) {
        new BadFormalsToCalls().go();
    }

    void go() {
        new B().noargs();
        Tester.check(noargsCalled, "noargs wasn't called");
    }
    
    class B {
        public void noargs() {
        }
    }    
}

aspect CallsNoArgsAspect {
    pointcut noargs(BadFormalsToCalls.B b): call(void noargs());
    void around(BadFormalsToCalls.B b): noargs(b) {
        proceed(b);
    }
}