diff options
author | wisberg <wisberg> | 2003-09-07 19:04:00 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2003-09-07 19:04:00 +0000 |
commit | 2b381b0196e56f8d2605998da82e4bebeccc4805 (patch) | |
tree | 4f64658a23706e21d16b2f666e2ee00e325697be /tests/bugs | |
parent | 8ced0584cb2cecd8db9bb9733230027d7c4a5d40 (diff) | |
download | aspectj-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/bugs')
3 files changed, 200 insertions, 0 deletions
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()); + } +} |