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.

InterfaceWithInnerClass.java 749B

1234567891011121314151617181920212223242526272829303132
  1. import org.aspectj.lang.annotation.Aspect;
  2. import org.aspectj.lang.annotation.Before;
  3. import org.aspectj.lang.JoinPoint;
  4. /**
  5. * https://github.com/eclipse/org.aspectj/issues/162
  6. */
  7. public interface InterfaceWithInnerClass {
  8. public class ImplicitlyStatic {
  9. public int getNumber() {
  10. return 11;
  11. }
  12. public static void main(String[] args) {
  13. System.out.println(new ImplicitlyStatic().getNumber());
  14. }
  15. }
  16. /*static*/ aspect MyAspect {
  17. before() : execution(* main(..)) {
  18. System.out.println(thisJoinPoint);
  19. }
  20. }
  21. @Aspect
  22. /*static*/ class MyAnnotationAspect {
  23. @Before("execution(* getNumber(..))")
  24. public void myAdvice(JoinPoint thisJoinPoint){
  25. System.out.println(thisJoinPoint);
  26. }
  27. }
  28. }