aboutsummaryrefslogtreecommitdiffstats
path: root/tests/errors/StaticAdviceOnAbstract.java
blob: 4975bd4822533ab333814be8544a54f6de5f9e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
abstract aspect StaticAdviceOnAbstract {
     abstract pointcut i();

     pointcut j(): 
	 i()
	 && !this(StaticAdviceOnAbstract)
	 && call(new(..)) ;
}

aspect Concrete {
     // static advice indirectly on an abstract pointcut
     after() returning(Object o): StaticAdviceOnAbstract.j() {
         System.out.println("we have"+o);
     }

     // a simple case of directly on abstract pointcut
     after() returning(Object o): StaticAdviceOnAbstract.i() {
         System.out.println("we have"+o);
     }
}