blob: ef1711d2deadf220a5e19b97ff5c2afa0ead60af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import org.aspectj.lang.reflect.MethodSignature;
public aspect MainAspect {
pointcut testcall(): execution(* test*(..));
before(): testcall() {
MethodSignature sig =
(MethodSignature) thisJoinPointStaticPart.getSignature();
System.out.println(sig);
Class[] params = sig.getParameterTypes();
for(int i=0;i<params.length;i++) {
Class cls = params[i];
String name = cls.getName();
System.out.println(" - " + name);
if (name.indexOf("ClassNotFoundException")!=-1) throw new RuntimeException("");
}
}
}
|