summaryrefslogtreecommitdiffstats
path: root/tests/new/NamedWithinPointcuts.java
blob: 92a628dc8c9b8c22e958a15a5761cb53f581863e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import org.aspectj.testing.Tester; 

public class NamedWithinPointcuts {
    public static void main (String[] args) { 
        Tester.expectEvent("before"); 
        Tester.checkAllEventsIgnoreDups();
    } 
}

aspect Test {
    pointcut withinAspects() : within(Test) ;

    static void log() { }

    /** @testcase PR#635 Named Within pointcuts failing */
    //before() : !within(Test) {    // works fine
    before() : !(withinAspects()) { // stack overflow
        log();     // comment out to avoid stack overflow
        Tester.event("before");
    }
}