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.

ThreadNoField.java 815B

12345678910111213141516171819202122232425262728
  1. public class ThreadNoField {
  2. public static void main (String[] args) {
  3. Target.main(args);
  4. }
  5. }
  6. aspect Aspect {
  7. static final String[] SIGNALS = new String[]
  8. { "around - start"
  9. , "around - run - before proceed"
  10. , "around - run - after proceed"
  11. };
  12. /** @testcase PR#620 around advice inner Thread subclass running proceed but not writing field */
  13. int around(): Target.pointcutTarget() {
  14. Thread runner = new Thread() {
  15. public void run() {
  16. Common.signal(SIGNALS[1]);
  17. proceed();
  18. Common.signal(SIGNALS[2]);
  19. }
  20. };
  21. runner.start();
  22. Common.joinWith(runner);
  23. Common.signal(SIGNALS[0]);
  24. return 1; // hard-wired since no result
  25. }
  26. }