]> source.dussan.org Git - aspectj.git/commitdiff
fix for Bugzilla Bug 61572
authoracolyer <acolyer>
Tue, 10 Aug 2004 16:26:24 +0000 (16:26 +0000)
committeracolyer <acolyer>
Tue, 10 Aug 2004 16:26:24 +0000 (16:26 +0000)
  ITDs on inner classes should be static contexts

org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
org.eclipse.jdt.core/jdtcore-for-aspectj.jar
tests/bugs/PR61572.aj [new file with mode: 0644]

index 98dfa88007f5a6e488a93ffae9082eafb9202d6a..34c57f137d57258a91077c885150d4e4ec8f0e46 100644 (file)
Binary files a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip and b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip differ
index c0d1e166bcffd353d4ec8c376bea5830c50b44e7..e0e8c9701d8ca0f18a91da0f3e92decb8133069a 100644 (file)
Binary files a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar and b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar differ
diff --git a/tests/bugs/PR61572.aj b/tests/bugs/PR61572.aj
new file mode 100644 (file)
index 0000000..0f29c13
--- /dev/null
@@ -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