blob: 507bef54ff05889d3dae0dd2c06364dcc5fe897c (
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
27
28
29
30
31
32
|
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.JoinPoint;
/**
* https://github.com/eclipse-aspectj/aspectj/issues/162
*/
public interface InterfaceWithInnerClass {
public class ImplicitlyStatic {
public int getNumber() {
return 11;
}
public static void main(String[] args) {
System.out.println(new ImplicitlyStatic().getNumber());
}
}
/*static*/ aspect MyAspect {
before() : execution(* main(..)) {
System.out.println(thisJoinPoint);
}
}
@Aspect
/*static*/ class MyAnnotationAspect {
@Before("execution(* getNumber(..))")
public void myAdvice(JoinPoint thisJoinPoint){
System.out.println(thisJoinPoint);
}
}
}
|