diff options
author | wisberg <wisberg> | 2004-09-27 21:14:44 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2004-09-27 21:14:44 +0000 |
commit | 3ea58899058ca5ff3ec3f9ad7396cfde56bda2a5 (patch) | |
tree | a4b5bbbab65c1b209756d6fd2dbeb4f0bed6c75d /tests | |
parent | 535fb43192d72bc4c4aee777b923f86b81576e1b (diff) | |
download | aspectj-3ea58899058ca5ff3ec3f9ad7396cfde56bda2a5.tar.gz aspectj-3ea58899058ca5ff3ec3f9ad7396cfde56bda2a5.zip |
@testcase PR#75129 NPE on thisJoinPoint mistake
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ajcTestsFailing.xml | 9 | ||||
-rw-r--r-- | tests/bugs/TjpMistake.java | 29 |
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml index 167f12d9e..a15692546 100644 --- a/tests/ajcTestsFailing.xml +++ b/tests/ajcTestsFailing.xml @@ -152,5 +152,14 @@ files="Test_AroundVarBug.java,AroundVarBug.java"/> <run class="Test_AroundVarBug"/> </ajc-test> + + <ajc-test + dir="bugs" + pr="75129" + title="NPE on thisJoinPoint mistake"> + <compile files="TjpMistake.java"> + <message kind="error" line="22"/> + </compile> + </ajc-test> </suite> diff --git a/tests/bugs/TjpMistake.java b/tests/bugs/TjpMistake.java new file mode 100644 index 000000000..4934da278 --- /dev/null +++ b/tests/bugs/TjpMistake.java @@ -0,0 +1,29 @@ +/** @testcase PR#75129 NPE on thisJoinPoint mistake */ +public class TjpMistake { +public static void main(String[] a) { + new C().go(); + new D().go(); + new E().go(); +} +} +interface I { void go();} +class C {} +class D { + public void go() { System.out.println("D.go() in " + this); } +} +class E extends D { +} +aspect A { + declare parents: (C || D) implements I; + public void I.go() { System.out.println("I.go() in " + this); } + before() : execution(* I.*(..)) { + System.out.println( + // mistake caused compiler crash rather than error + thisJoinPoint.getSignature.toLongString() // CE 22 + // correct + //thisJoinPointStaticPart.getSignature().toLongString() + + " " + + thisJoinPoint.getSignature().getDeclaringType() + + " " + + this); } +} |