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.

PR83563_2.java 644B

12345678910111213141516171819202122232425
  1. public class PR83563_2 {
  2. public void bar() {
  3. new Runnable() {
  4. public void run() {
  5. System.out.println("Running...");
  6. }
  7. }.run();
  8. }
  9. public static void main(String[] args) {
  10. new PR83563_2().bar();
  11. int c = PertypewithinTest.aspectOf(PR83563_2.class).cnt;
  12. if (c!=3)
  13. throw new RuntimeException("Expected 3 advice executions but got:"+c);
  14. }
  15. }
  16. aspect PertypewithinTest pertypewithin(PR83563_2) {
  17. public static int cnt = 0;
  18. before() : execution(* *.*(..)) {
  19. cnt++;
  20. System.out.println(thisJoinPoint);
  21. }
  22. }