You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MainAspect.java 587B

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