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.

MethodInner.java 471B

1234567891011121314151617181920212223242526272829
  1. import org.aspectj.testing.Tester;
  2. public class MethodInner {
  3. public static void main(String[] args) { test(); }
  4. public static void test() {
  5. Tester.checkEqual(new C().foo(), 10, "inner");
  6. }
  7. }
  8. class C {
  9. int foo() {
  10. final int N = 10;
  11. class Inner {
  12. public int bar() {
  13. return N;
  14. }
  15. }
  16. return new Inner().bar();
  17. }
  18. }
  19. aspect A issingleton() {
  20. before(): execution(int *(..)) {
  21. System.out.println("before: " + thisJoinPoint);
  22. }
  23. }