aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/AfterConstructorCalls.java
blob: 80f5dcb627e4940fd839b5f818d0341b384e30cd (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
import org.aspectj.testing.Tester;

public class AfterConstructorCalls {
    public static void main(String[] args) {
        new Foo().bar();
    }
}

class Foo {
    int bar() { return 0; }
}

aspect A {
    pointcut nimboCut() : 
        call(Foo.new(..));
    
    /*static*/ after() returning (Object o): nimboCut() {
        Tester.check(o != null && o instanceof Foo, o + " !instanceof Foo");
    }

    /*static*/ after() returning (int i): call(int Foo.*(..)) {
        Tester.checkEqual(i, 0);
    }
}