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.

HandlerSignature.java 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import org.aspectj.testing.Tester;
  2. import java.util.*;
  3. /** @testcase PR#883 Getting signature from handler join point */
  4. public class HandlerSignature {
  5. public static void main(String[] args) {
  6. C c = new C();
  7. U.ee("caught");
  8. try {
  9. c.run();
  10. } catch (Error e) {
  11. U.e("caught");
  12. }
  13. Tester.checkAllEvents();
  14. }
  15. static {
  16. // U.ee("X");
  17. }
  18. }
  19. class C {
  20. public void run() {
  21. throw new Error("");
  22. }
  23. }
  24. class U {
  25. static void e(String event) {
  26. System.err.println(event);
  27. Tester.event(event);
  28. }
  29. static void ee(String event) {
  30. Tester.expectEvent(event);
  31. }
  32. }
  33. aspect A {
  34. static {
  35. U.ee("before handler");
  36. //U.ee("after handler");
  37. }
  38. before() : handler(*) {
  39. thisJoinPoint.getSignature().getModifiers();
  40. U.e("before handler");
  41. }
  42. /*
  43. after returning join points not implemented
  44. after() returning: handler(*) {
  45. thisJoinPoint.getSignature().getModifiers();
  46. U.e("after handler");
  47. }
  48. */
  49. }