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_1.java 610B

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