aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2004-08-16 16:16:20 +0000
committeraclement <aclement>2004-08-16 16:16:20 +0000
commit6b1ef0ff7cfd1dbb985993fd5486c9ddf31b280d (patch)
tree5b32bce26fe427aabe1d83d571f06a60f037d317
parent36e24edf8dfc3acbd35e7d93df2e52834cc15ac1 (diff)
downloadaspectj-6b1ef0ff7cfd1dbb985993fd5486c9ddf31b280d.tar.gz
aspectj-6b1ef0ff7cfd1dbb985993fd5486c9ddf31b280d.zip
Fixes for:
Bugzilla Bug 67578: Privileged Aspect Access Problem Across Packages Bugzilla Bug 67579: NPE on privileged aspect error
-rw-r--r--org.eclipse.jdt.core/jdtcore-for-aspectj-src.zipbin3813361 -> 3832874 bytes
-rw-r--r--org.eclipse.jdt.core/jdtcore-for-aspectj.jarbin4279578 -> 4280016 bytes
-rw-r--r--tests/bugs/privilegedAccess/a/ITD.aj6
-rw-r--r--tests/bugs/privilegedAccess/b/B.aj13
-rw-r--r--tests/bugs/privilegedAccess/b/B_notPrivileged.aj13
-rw-r--r--tests/bugs/privilegedNPE/B.aj11
-rw-r--r--tests/bugs/privilegedNPE/ITD.aj5
-rw-r--r--tests/bugs/privilegedNPE/a/ITD.aj6
-rw-r--r--tests/bugs/privilegedNPE/b/B.aj13
-rw-r--r--tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java16
-rw-r--r--tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml24
11 files changed, 107 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip b/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
index 9662dce55..3e7018819 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 fb205d9a9..004291532 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/privilegedAccess/a/ITD.aj b/tests/bugs/privilegedAccess/a/ITD.aj
new file mode 100644
index 000000000..47009cd8c
--- /dev/null
+++ b/tests/bugs/privilegedAccess/a/ITD.aj
@@ -0,0 +1,6 @@
+package a;
+
+public class ITD {
+ private void returnNothing(Object a) {
+ }
+} \ No newline at end of file
diff --git a/tests/bugs/privilegedAccess/b/B.aj b/tests/bugs/privilegedAccess/b/B.aj
new file mode 100644
index 000000000..46f2b1a68
--- /dev/null
+++ b/tests/bugs/privilegedAccess/b/B.aj
@@ -0,0 +1,13 @@
+package b;
+
+import a.*;
+
+privileged aspect B {
+ public void ITD.newFun() {
+ returnNothing("a");
+ }
+
+ public static void main(String [] argv) {
+ new ITD().newFun();
+ }
+}
diff --git a/tests/bugs/privilegedAccess/b/B_notPrivileged.aj b/tests/bugs/privilegedAccess/b/B_notPrivileged.aj
new file mode 100644
index 000000000..9ba5e9142
--- /dev/null
+++ b/tests/bugs/privilegedAccess/b/B_notPrivileged.aj
@@ -0,0 +1,13 @@
+package b;
+
+import a.*;
+
+aspect B {
+ public void ITD.newFun() {
+ returnNothing("a");
+ }
+
+ public static void main(String [] argv) {
+ new ITD().newFun();
+ }
+}
diff --git a/tests/bugs/privilegedNPE/B.aj b/tests/bugs/privilegedNPE/B.aj
new file mode 100644
index 000000000..ae872061d
--- /dev/null
+++ b/tests/bugs/privilegedNPE/B.aj
@@ -0,0 +1,11 @@
+
+
+privileged aspect B {
+ void blah(ITD x) { x.returnNothing("y"); }
+
+ public static void main(String[]argv) {
+ ITD a = new ITD();
+ a.returnNothing("a");
+ System.err.println("Call returned OK!");
+ }
+}
diff --git a/tests/bugs/privilegedNPE/ITD.aj b/tests/bugs/privilegedNPE/ITD.aj
new file mode 100644
index 000000000..bf2333d10
--- /dev/null
+++ b/tests/bugs/privilegedNPE/ITD.aj
@@ -0,0 +1,5 @@
+
+public class ITD {
+ private void returnNothing(Object a) {
+ }
+}
diff --git a/tests/bugs/privilegedNPE/a/ITD.aj b/tests/bugs/privilegedNPE/a/ITD.aj
new file mode 100644
index 000000000..78cd23d4e
--- /dev/null
+++ b/tests/bugs/privilegedNPE/a/ITD.aj
@@ -0,0 +1,6 @@
+package a;
+
+public class ITD {
+ private void returnNothing(Object a) {
+ }
+}
diff --git a/tests/bugs/privilegedNPE/b/B.aj b/tests/bugs/privilegedNPE/b/B.aj
new file mode 100644
index 000000000..9d8796a67
--- /dev/null
+++ b/tests/bugs/privilegedNPE/b/B.aj
@@ -0,0 +1,13 @@
+package b;
+
+import a.*;
+
+privileged aspect B {
+ void blah(ITD x) { x.returnNothing("y"); }
+
+ public static void main(String[]argv) {
+ ITD a = new ITD();
+ a.returnNothing("a");
+ System.err.println("Call returned OK!");
+ }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java
index 1d7964940..391d5f89f 100644
--- a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java
@@ -210,5 +210,21 @@ public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
s.equals(":before:around"));
}
+ public void test039_privilegedAspectAccessingPrivateMethods_pr67579() {
+ runTest("NPE on privileged aspect error");
+ }
+
+ public void test040_privilegedAspectAccessingPrivateMethods_pr67579_2() {
+ runTest("NPE on privileged aspect error (2)");
+ }
+
+ public void test041_ITDaccessingPrivateMethod_pr67578() {
+ runTest("Privileged Aspect Access Problem Across Packages");
+ }
+
+ public void test042_ITDaccessingPrivateMethod_pr67578_2() {
+ runTest("Privileged Aspect Access Problem Across Packages (2)");
+ }
+
}
diff --git a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml
index 1ebf21c7a..45ba9dcf8 100644
--- a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml
+++ b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml
@@ -305,3 +305,27 @@
<run class="def.PrivateCall_Instance_Package2"/>
</ajc-test>
+ <ajc-test dir="bugs/privilegedNPE" pr="67579"
+ title="NPE on privileged aspect error">
+ <compile files="a\ITD.aj,b\B.aj"/>
+ <run class="b.B"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/privilegedNPE" pr="67579"
+ title="NPE on privileged aspect error (2)">
+ <compile files="b\B.aj,a\ITD.aj"/>
+ <run class="b.B"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/privilegedAccess" pr="67578"
+ title="Privileged Aspect Access Problem Across Packages">
+ <compile files="b\B.aj,a\ITD.aj"/>
+ <run class="b.B"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs/privilegedAccess" pr="67578"
+ title="Privileged Aspect Access Problem Across Packages (2)">
+ <compile files="b\B_notPrivileged.aj,a\ITD.aj">
+ <message kind="error" line="7" text="The method returnNothing(Object) from the type ITD is not visible"/>
+ </compile>
+ </ajc-test>