blob: 0e3f191b01e5770c9625d6f1e5da3319702ddf8e (
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.lang.reflect.MethodSignature;
class A<X> { }
class Base {
public A<String> foo() { return null; }
}
public aspect Demo {
public A<String> Base.bar() { return null; }
public Base Base.baz() { return null; }
before(): execution(* Base.*(..)) {
Class<?> cs = ((MethodSignature)thisJoinPointStaticPart.getSignature()).getReturnType();
System.out.format("%s (%b)%n",
cs,
ClassNotFoundException.class == cs);
}
public static void main(String[] arg) {
new Base().foo();
new Base().bar();
new Base().baz();
}
}
|