diff options
Diffstat (limited to 'tests/new')
-rw-r--r-- | tests/new/EmptyInterface.java | 9 | ||||
-rw-r--r-- | tests/new/EmptyInterfaceCE.java | 32 |
2 files changed, 37 insertions, 4 deletions
diff --git a/tests/new/EmptyInterface.java b/tests/new/EmptyInterface.java index db53d592a..aca01b6a8 100644 --- a/tests/new/EmptyInterface.java +++ b/tests/new/EmptyInterface.java @@ -17,11 +17,12 @@ public class EmptyInterface { aspect Log { static int hits; static StringBuffer log = new StringBuffer(); - interface LoggedType {} + interface LoggedType { + } declare parents: C implements LoggedType; - void around() : within(LoggedType+) - && !initialization(new(..)) - && !preinitialization(new(..)) // 1.1 only + after() : within(LoggedType+) + //&& !initialization(new(..)) + //&& !preinitialization(new(..)) // 1.1 only { hits++; log.append(thisJoinPoint + ";"); diff --git a/tests/new/EmptyInterfaceCE.java b/tests/new/EmptyInterfaceCE.java new file mode 100644 index 000000000..4fdbbed33 --- /dev/null +++ b/tests/new/EmptyInterfaceCE.java @@ -0,0 +1,32 @@ + + +import org.aspectj.testing.Tester; + +/** @testcase PR#36778 advise join points in subclass of empty interface */ +public class EmptyInterfaceCE { + + public static void main(String[] args) { + new C().go(); + // at least constructor and method execution + if (2 > Log.hits) { + Tester.check(false, Log.log.toString()); + } + } +} + +aspect Log { + static int hits; + static StringBuffer log = new StringBuffer(); + interface LoggedType { + } + declare parents: C implements LoggedType; + void around() : staticinitialization(LoggedType) // CE: limitation + { + hits++; + log.append(thisJoinPoint + ";"); + } +} + +class C { + void go() {} +} |