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.

Demo.java 555B

1234567891011121314151617181920212223242526
  1. import org.aspectj.lang.reflect.MethodSignature;
  2. class A<X> { }
  3. class Base {
  4. public A<String> foo() { return null; }
  5. }
  6. public aspect Demo {
  7. public A<String> Base.bar() { return null; }
  8. public Base Base.baz() { return null; }
  9. before(): execution(* Base.*(..)) {
  10. Class<?> cs = ((MethodSignature)thisJoinPointStaticPart.getSignature()).getReturnType();
  11. System.out.format("%s (%b)%n",
  12. cs,
  13. ClassNotFoundException.class == cs);
  14. }
  15. public static void main(String[] arg) {
  16. new Base().foo();
  17. new Base().bar();
  18. new Base().baz();
  19. }
  20. }