aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs
diff options
context:
space:
mode:
authorwisberg <wisberg>2004-09-27 21:14:44 +0000
committerwisberg <wisberg>2004-09-27 21:14:44 +0000
commit3ea58899058ca5ff3ec3f9ad7396cfde56bda2a5 (patch)
treea4b5bbbab65c1b209756d6fd2dbeb4f0bed6c75d /tests/bugs
parent535fb43192d72bc4c4aee777b923f86b81576e1b (diff)
downloadaspectj-3ea58899058ca5ff3ec3f9ad7396cfde56bda2a5.tar.gz
aspectj-3ea58899058ca5ff3ec3f9ad7396cfde56bda2a5.zip
@testcase PR#75129 NPE on thisJoinPoint mistake
Diffstat (limited to 'tests/bugs')
-rw-r--r--tests/bugs/TjpMistake.java29
1 files changed, 29 insertions, 0 deletions
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); }
+}