diff options
Diffstat (limited to 'tests/new/EachJVMOnSelf.java')
-rw-r--r-- | tests/new/EachJVMOnSelf.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/new/EachJVMOnSelf.java b/tests/new/EachJVMOnSelf.java new file mode 100644 index 000000000..cbbd1eeae --- /dev/null +++ b/tests/new/EachJVMOnSelf.java @@ -0,0 +1,20 @@ +import org.aspectj.testing.Tester; + +public class EachJVMOnSelf { + public static void main(String[] args) { + new C(); + + Tester.checkEqual(A.aspectOf().advisedNewClass, "C"); + } +} + +aspect A issingleton() { + String advisedNewClass = null; + + after () returning (): this(*) && execution(new(..)) { + advisedNewClass = thisJoinPoint.getSourceLocation().getWithinType().getName(); + } +} + +class C { +} |