diff options
author | acolyer <acolyer> | 2004-08-10 16:26:24 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2004-08-10 16:26:24 +0000 |
commit | c5d8476b232fa84f766a1a84d1ab45ad8e3867b8 (patch) | |
tree | bcc69f27d0f107412310974e77d7c79b70e9ccc4 /tests | |
parent | b75cd93e0de66996397e9f18809973abec91fe46 (diff) | |
download | aspectj-c5d8476b232fa84f766a1a84d1ab45ad8e3867b8.tar.gz aspectj-c5d8476b232fa84f766a1a84d1ab45ad8e3867b8.zip |
fix for Bugzilla Bug 61572
ITDs on inner classes should be static contexts
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs/PR61572.aj | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/bugs/PR61572.aj b/tests/bugs/PR61572.aj new file mode 100644 index 000000000..0f29c1303 --- /dev/null +++ b/tests/bugs/PR61572.aj @@ -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(); + } + +}
\ No newline at end of file |