mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-13 15:45:38 +02:00
fix for Bugzilla Bug 61572
ITDs on inner classes should be static contexts
This commit is contained in:
parent
b75cd93e0d
commit
c5d8476b23
Binary file not shown.
Binary file not shown.
44
tests/bugs/PR61572.aj
Normal file
44
tests/bugs/PR61572.aj
Normal file
@ -0,0 +1,44 @@
|
||||
/* intertype method declarations should be a static context;
|
||||
it is incorrect to refer to instance variables of the
|
||||
originating aspect. ajc fails to check this properly when
|
||||
an ITD method is applied to an inner class.
|
||||
|
||||
The example below compiles fine, but then throws
|
||||
|
||||
java.lang.NoSuchFieldError: zzz
|
||||
|
||||
when run.
|
||||
|
||||
*/
|
||||
|
||||
aspect NewFoo {
|
||||
|
||||
int zzz = 3;
|
||||
|
||||
public void Aaa.Ccc.bar() {
|
||||
System.out.println(zzz); // CE L19: illegal reference to zzz
|
||||
}
|
||||
}
|
||||
|
||||
class Aaa {
|
||||
|
||||
public class Ccc {
|
||||
|
||||
}
|
||||
|
||||
public Ccc ccc;
|
||||
|
||||
public Aaa() {
|
||||
ccc = new Ccc();
|
||||
}
|
||||
}
|
||||
|
||||
class IllegalRef {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
Aaa aaa = new Aaa();
|
||||
aaa.ccc.bar();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user