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.

TypeNames.java 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import org.aspectj.testing.Tester;
  2. /** @testcase package typepattern with no packages (in default package) */
  3. public class TypeNames {
  4. public static void main (String[] args) {
  5. new Suffix().run();
  6. new MySuffix().run();
  7. Tester.checkAllEvents();
  8. }
  9. static {
  10. Tester.expectEvent("Suffix.run()");
  11. Tester.expectEvent("MySuffix.run()");
  12. }
  13. }
  14. // classes not to be matched by TypePattern below
  15. class Suffix {
  16. void run() {
  17. Tester.event("Suffix.run()");
  18. }
  19. }
  20. class MySuffix {
  21. void run() {
  22. Tester.event("MySuffix.run()");
  23. }
  24. }
  25. aspect A {
  26. // BUG: This is all that's required to provoke the bug in -Xlint mode
  27. declare parents: *..*Suffix implements Runnable; // lint: no type matched
  28. // coverage cases
  29. before() : staticinitialization(*..*Suffix) { // lint: no type matched
  30. Tester.check(false, "no such join point");
  31. }
  32. before() : call(void *..*Suffix.run()) { // lint: no type matched
  33. Tester.check(false, "no such join point");
  34. }
  35. before() : call(*..*Suffix.new()) { // lint: no type matched
  36. Tester.check(false, "no such join point");
  37. }
  38. }