summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jdt.core/jdtcore-for-aspectj-src.zipbin3813341 -> 3813361 bytes
-rw-r--r--org.eclipse.jdt.core/jdtcore-for-aspectj.jarbin4279581 -> 4279578 bytes
-rw-r--r--tests/bugs/oxford/ITDScope.aj18
-rw-r--r--tests/bugs/oxford/PR61768.java56
-rw-r--r--tests/bugs/oxford/PR62475.java14
-rw-r--r--tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java15
-rw-r--r--tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml19
7 files changed, 99 insertions, 23 deletions
diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
index 34c57f137..9662dce55 100644
--- a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
+++ b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
Binary files differ
diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
index e0e8c9701..fb205d9a9 100644
--- a/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
+++ b/org.eclipse.jdt.core/jdtcore-for-aspectj.jar
Binary files differ
diff --git a/tests/bugs/oxford/ITDScope.aj b/tests/bugs/oxford/ITDScope.aj
new file mode 100644
index 000000000..cf49a2fa8
--- /dev/null
+++ b/tests/bugs/oxford/ITDScope.aj
@@ -0,0 +1,18 @@
+class C {
+
+ static int static_c = 0;
+ int c = 0;
+
+}
+
+aspect A {
+ static int static_a = 0;
+ int a = 0;
+
+ private void C.itdFromA() {
+ c = 1; // ok
+ static_c = 1; // not ok - use C.static_c;
+ static_a = 1; // ok
+ a = 1; // not ok
+ }
+} \ No newline at end of file
diff --git a/tests/bugs/oxford/PR61768.java b/tests/bugs/oxford/PR61768.java
new file mode 100644
index 000000000..eca26e215
--- /dev/null
+++ b/tests/bugs/oxford/PR61768.java
@@ -0,0 +1,56 @@
+/* According to the documentation, the scope rules for
+intertype method declarations are interpreted
+from the originating aspect. The only exceptions
+(I thought) are the use of "this" and "super" which refer to
+the target type.
+
+According to that interpretation, the program below is type correct, but
+ajc generates two error messages, shown in comments
+at the relevant lines. Note that it's ok to access private static
+fields of the aspect, but not to use private classes of the aspect.
+
+If this is a feature and not a bug, what are the
+precise scope rules for intertype method declarations?
+*/
+
+aspect Aspect {
+
+ private static int y = 5;
+
+ private class A { int x = 3; }
+
+ private static class A2 {}
+
+ private static void B.happy() {
+System.out.println(y); // happy accessing private field y
+ }
+
+ private static void B.foo(A z) {
+System.out.println(z.x);
+ }
+
+ private static void B.foo2(A2 z) {
+ System.out.println(z);
+ }
+
+ public void B.bar() {
+ B.foo(new A()); // CE L37 : no enclosing instance
+ }
+
+ public void B.bar2() {
+ B.foo2(new A2());
+ }
+
+}
+
+class B {
+}
+
+class IT {
+
+
+ public static void main(String[] args) {
+new B().bar();
+ }
+
+} \ No newline at end of file
diff --git a/tests/bugs/oxford/PR62475.java b/tests/bugs/oxford/PR62475.java
index 3e29ffb0a..993dbc4cc 100644
--- a/tests/bugs/oxford/PR62475.java
+++ b/tests/bugs/oxford/PR62475.java
@@ -1,18 +1,8 @@
-/*
-Intertype field initialisers should be resolved in the aspect
-(lexical scope), for consistency with intertype method and
-constructor bodies.
-
-The program below compiles without warning, however, binding z
-to the z field of the target class.
-*/
-
-
aspect Aspect {
- public int A.x = z; // CE L14 error: z not visible.
-
+ public int A.x = z; // okay, z is visible.
+
}
class A {
diff --git a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java
index 805397df1..0e5654ec6 100644
--- a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java
@@ -10,7 +10,9 @@
package org.aspectj.systemtest.ajc121;
import java.io.File;
+
import junit.framework.Test;
+
import org.aspectj.testing.XMLBasedAjcTestCase;
public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
@@ -148,15 +150,15 @@ public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("ITDs on inner classes should be static context");
}
-// public void test028_itdsAndInitializers() {
-// runTest("resolution of IT field inits");
-// }
+ public void test028_itdsAndInitializers() {
+ runTest("resolution of IT field inits");
+ }
public void test029_falseInvalidAbsoluteTypeName() {
runTest("Valid but inaccessible type names should not be flagged by XLint:invalidAbsoluteTypeName");
}
- public void test030_privateITDinitialisersBeingMatched() {
+ public void test030_privateITDinitialisersBeingMatched() {
runTest("intertype initialisers should match field set pointcuts");
}
@@ -175,5 +177,10 @@ public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void test033_stringConcatForDEOWErrorCase() {
runTest("Compile time declarations (warning and error) do not accept string concatenation (with +) (2)");
}
+
+ public void test034_scopeForITDS_pr61768() {
+ runTest("scope for inter-type methods");
+ }
+
}
diff --git a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml
index e1c6c5481..c11ce0228 100644
--- a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml
+++ b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml
@@ -224,14 +224,13 @@
</compile>
</ajc-test>
-<!--
- <ajc-test dir="bugs/oxford" pr="62475"
+<!-- should NOT raise error, despite Oxford expectations to the contrary -->
+ <ajc-test dir="bugs/oxford" pr="62475"
title="resolution of IT field inits">
<compile files="PR62475.java">
- <message kind="error" line="14" />
</compile>
</ajc-test>
--->
+
<ajc-test
dir="bugs/invalidAbsoluteTypeName"
@@ -242,8 +241,8 @@
</compile>
<run class="False_InvalidAbsoluteTypeName"/>
</ajc-test>
-
- <ajc-test dir="bugs/PR68991" pr="68991"
+
+ <ajc-test dir="bugs/PR68991" pr="68991"
title="intertype initialisers should match field set pointcuts">
<compile files="Simple.java"/>
<run class="Simple"/>
@@ -274,4 +273,10 @@
<message kind="error" line="22"/>
</compile>
</ajc-test>
-
+
+ <ajc-test dir="bugs/oxford" pr="61768"
+ title="scope for inter-type methods">
+ <compile files="PR61768.java">
+ <message kind="error" line="37" text="No enclosing instance of type Aspect is accessible"/>
+ </compile>
+ </ajc-test> \ No newline at end of file