aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorwisberg <wisberg>2003-09-07 19:04:00 +0000
committerwisberg <wisberg>2003-09-07 19:04:00 +0000
commit2b381b0196e56f8d2605998da82e4bebeccc4805 (patch)
tree4f64658a23706e21d16b2f666e2ee00e325697be /tests
parent8ced0584cb2cecd8db9bb9733230027d7c4a5d40 (diff)
downloadaspectj-2b381b0196e56f8d2605998da82e4bebeccc4805.tar.gz
aspectj-2b381b0196e56f8d2605998da82e4bebeccc4805.zip
@testcase PR#XXX omnibus privileged access from aspectj-users mail "Problem with interfaces in method's signature"
Diffstat (limited to 'tests')
-rw-r--r--tests/ajcTestsFailing.xml13
-rw-r--r--tests/bugs/privilege/packageProtected/concern/BaseTarget.java54
-rw-r--r--tests/bugs/privilege/packageProtected/concern/ContextUser.java95
-rw-r--r--tests/bugs/privilege/packageProtected/core/Base.java51
4 files changed, 212 insertions, 1 deletions
diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml
index 485c4e1e6..3a66c89e0 100644
--- a/tests/ajcTestsFailing.xml
+++ b/tests/ajcTestsFailing.xml
@@ -4,7 +4,18 @@
<!-- contains valid tests that the compiler has never passed -->
<suite>
-
+
+ <ajc-test dir="bugs/privilege"
+ title="omnibus privileged access"
+ comment="from mail ~Problem with interfaces...~; add pr when bug submitted"
+ >
+ <compile files="packageProtected/concern/ContextUser.java,
+ packageProtected/concern/BaseTarget.java,
+ packageProtected/core/Base.java"/>
+ <run class="packageProtected.core.Base"/>
+ <run class="packageProtected.concern.BaseTarget"/>
+ </ajc-test>
+
<ajc-test dir="bugs"
title="after returning type incompatible with join point return type"
pr="42668"
diff --git a/tests/bugs/privilege/packageProtected/concern/BaseTarget.java b/tests/bugs/privilege/packageProtected/concern/BaseTarget.java
new file mode 100644
index 000000000..b8dd79521
--- /dev/null
+++ b/tests/bugs/privilege/packageProtected/concern/BaseTarget.java
@@ -0,0 +1,54 @@
+package packageProtected.concern;
+
+public class BaseTarget {
+
+ // ---- same as Base
+ int default_int;
+ public int public_int;
+ protected int protected_int;
+ private int private_int;
+
+ void default_method() { }
+ public void public_method() { }
+ protected void protected_method() { }
+ private void private_method() { }
+
+ void default_method(Object unused) { }
+ public void public_method(Object unused) { }
+ protected void protected_method(Object unused) { }
+ private void private_method(Object unused) { }
+
+ void default_method(Object unused, Object second) { }
+ public void public_method(Object unused, Object second) { }
+ protected void protected_method(Object unused, Object second) { }
+ private void private_method(Object unused, Object second) { }
+
+ static int default_staticInt;
+ public static int public_staticInt;
+ protected static int protected_staticInt;
+ private static int private_staticInt;
+
+ static void default_staticMethod() { }
+ public static void public_staticMethod() { }
+ protected static void protected_staticMethod() { }
+ private static void private_staticMethod() { }
+
+ static void default_staticMethod(Object unused) { }
+ public static void public_staticMethod(Object unused) { }
+ protected static void protected_staticMethod(Object unused) { }
+ private static void private_staticMethod(Object unused) { }
+
+ static void default_staticMethod(Object unused, Object second) { }
+ public static void public_staticMethod(Object unused, Object second) { }
+ protected static void protected_staticMethod(Object unused, Object second) { }
+ private static void private_staticMethod(Object unused, Object second) { }
+ // ---- end of same as Base
+
+
+ public void trigger(BaseTarget me) {
+ }
+ public static void main(String[] args) {
+ BaseTarget user = new BaseTarget();
+ user.trigger(new BaseTarget());
+ }
+}
diff --git a/tests/bugs/privilege/packageProtected/concern/ContextUser.java b/tests/bugs/privilege/packageProtected/concern/ContextUser.java
new file mode 100644
index 000000000..b9571f668
--- /dev/null
+++ b/tests/bugs/privilege/packageProtected/concern/ContextUser.java
@@ -0,0 +1,95 @@
+package packageProtected.concern;
+
+import packageProtected.core.Base;
+
+/** @testcase PR#XXX omnibus privileged access */
+public privileged aspect ContextUser {
+ pointcut call2trigger(Base argument):
+ execution(* Base.trigger(..))
+ && args(argument);
+
+ before(Base base): call2trigger(base) {
+ int i = base.private_int
+ + base.default_int
+ + base.protected_int
+ + base.public_int;
+ base.private_method();
+ base.default_method();
+ base.protected_method();
+ base.public_method();
+
+ base.private_method(null);
+ base.default_method(null);
+ base.protected_method(null);
+ base.public_method(null);
+
+ base.private_method(null, null);
+ base.default_method(null, null);
+ base.protected_method(null, null);
+ base.public_method(null, null);
+
+
+ i = Base.private_staticInt
+ + Base.default_staticInt
+ + Base.protected_staticInt
+ + Base.public_staticInt;
+ Base.private_staticMethod();
+ Base.default_staticMethod();
+ Base.protected_staticMethod();
+ Base.public_staticMethod();
+
+ Base.private_staticMethod(null);
+ Base.default_staticMethod(null);
+ Base.protected_staticMethod(null);
+ Base.public_staticMethod(null);
+
+ Base.private_staticMethod(null, null);
+ Base.default_staticMethod(null, null);
+ Base.protected_staticMethod(null, null);
+ Base.public_staticMethod(null, null);
+ }
+ pointcut call2trigger_samePackage(BaseTarget arg):
+ execution(* BaseTarget.trigger(..))
+ && args(arg);
+
+ before(BaseTarget base): call2trigger_samePackage(base) {
+
+ int i = base.private_int
+ + base.default_int
+ + base.protected_int
+ + base.public_int;
+ base.private_method();
+ base.default_method();
+ base.protected_method();
+ base.public_method();
+
+ base.private_method(null);
+ base.default_method(null);
+ base.protected_method(null);
+ base.public_method(null);
+
+ base.private_method(null, null);
+ base.default_method(null, null);
+ base.protected_method(null, null);
+ base.public_method(null, null);
+
+ i = BaseTarget.private_staticInt
+ + BaseTarget.default_staticInt
+ + BaseTarget.protected_staticInt
+ + BaseTarget.public_staticInt;
+ BaseTarget.private_staticMethod();
+ BaseTarget.default_staticMethod();
+ BaseTarget.protected_staticMethod();
+ BaseTarget.public_staticMethod();
+
+ BaseTarget.private_staticMethod(null);
+ BaseTarget.default_staticMethod(null);
+ BaseTarget.protected_staticMethod(null);
+ BaseTarget.public_staticMethod(null);
+
+ BaseTarget.private_staticMethod(null, null);
+ BaseTarget.default_staticMethod(null, null);
+ BaseTarget.protected_staticMethod(null, null);
+ BaseTarget.public_staticMethod(null, null);
+ }
+} \ No newline at end of file
diff --git a/tests/bugs/privilege/packageProtected/core/Base.java b/tests/bugs/privilege/packageProtected/core/Base.java
new file mode 100644
index 000000000..f2fafd0c4
--- /dev/null
+++ b/tests/bugs/privilege/packageProtected/core/Base.java
@@ -0,0 +1,51 @@
+package packageProtected.core;
+
+public class Base {
+ int default_int;
+ public int public_int;
+ protected int protected_int;
+ private int private_int;
+
+ void default_method() { }
+ public void public_method() { }
+ protected void protected_method() { }
+ private void private_method() { }
+
+ void default_method(Object unused) { }
+ public void public_method(Object unused) { }
+ protected void protected_method(Object unused) { }
+ private void private_method(Object unused) { }
+
+ void default_method(Object unused, Object second) { }
+ public void public_method(Object unused, Object second) { }
+ protected void protected_method(Object unused, Object second) { }
+ private void private_method(Object unused, Object second) { }
+
+ static int default_staticInt;
+ public static int public_staticInt;
+ protected static int protected_staticInt;
+ private static int private_staticInt;
+
+ static void default_staticMethod() { }
+ public static void public_staticMethod() { }
+ protected static void protected_staticMethod() { }
+ private static void private_staticMethod() { }
+
+ static void default_staticMethod(Object unused) { }
+ public static void public_staticMethod(Object unused) { }
+ protected static void protected_staticMethod(Object unused) { }
+ private static void private_staticMethod(Object unused) { }
+
+ static void default_staticMethod(Object unused, Object second) { }
+ public static void public_staticMethod(Object unused, Object second) { }
+ protected static void protected_staticMethod(Object unused, Object second) { }
+ private static void private_staticMethod(Object unused, Object second) { }
+
+
+ public void trigger(Base me) {
+ }
+ public static void main(String[] args) {
+ Base user = new Base();
+ user.trigger(new Base());
+ }
+}