Browse Source

fix for Bugzilla Bug 61572

 	ITDs on inner classes should be static contexts
tags/for_ajdt1_1_12
acolyer 20 years ago
parent
commit
c5d8476b23

BIN
org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip View File


BIN
org.eclipse.jdt.core/jdtcore-for-aspectj.jar View File


+ 44
- 0
tests/bugs/PR61572.aj View 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…
Cancel
Save