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.

12345678910111213141516171819202122232425262728293031323334
  1. import org.aspectj.testing.Tester;
  2. /** @testcase PR#36778 advise join points in subclass of empty interface */
  3. public class EmptyInterface {
  4. public static void main(String[] args) {
  5. new C().go();
  6. // at least constructor and method execution
  7. if (2 > Log.hits) {
  8. Tester.check(false, Log.log.toString());
  9. }
  10. }
  11. }
  12. aspect Log {
  13. static int hits;
  14. static StringBuffer log = new StringBuffer();
  15. interface LoggedType {
  16. }
  17. declare parents: C implements LoggedType;
  18. after(): within(LoggedType+)
  19. //&& !initialization(new(..))
  20. //&& !preinitialization(new(..)) // 1.1 only
  21. {
  22. hits++;
  23. log.append(thisJoinPoint + ";");
  24. }
  25. }
  26. class C {
  27. void go() {}
  28. }