aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/TjpMistake.java
blob: 4934da278ac18739e576dfe6b75e75233d95d479 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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); }
}