summaryrefslogtreecommitdiff
path: root/vm/reference/java/security
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2004-07-04 18:32:26 +0000
committerMark Wielaard <mark@klomp.org>2004-07-04 18:32:26 +0000
commit65ba2a5cc813f115066b88530df9f722369ca382 (patch)
treef4c781a11a5a2a416d32a0a2a4f7d719c3b14429 /vm/reference/java/security
parent919c524de832b82d982b0815a94e84dc7bd64e50 (diff)
downloadclasspath-65ba2a5cc813f115066b88530df9f722369ca382.tar.gz
2004-07-04 Casey Marshall <csm@gnu.org>
* java/security/AccessControlContext.java (checkPermission): check for empty context. * vm/reference/java/security/VMAccessController.java (getContext): combine debugging statements. (getStack): implemented. * NEWS: Describe new platform dependent VMAccessController class.
Diffstat (limited to 'vm/reference/java/security')
-rw-r--r--vm/reference/java/security/VMAccessController.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/vm/reference/java/security/VMAccessController.java b/vm/reference/java/security/VMAccessController.java
index a9a580f92..d2780dcdd 100644
--- a/vm/reference/java/security/VMAccessController.java
+++ b/vm/reference/java/security/VMAccessController.java
@@ -169,9 +169,11 @@ final class VMAccessController
Class clazz = classes[i];
String method = methods[i];
- if (DEBUG) debug (">>> checking " + clazz + "." + method);
-
- if (DEBUG) debug (">>> loader = " + clazz.getClassLoader());
+ if (DEBUG)
+ {
+ debug (">>> checking " + clazz + "." + method);
+ debug (">>> loader = " + clazz.getClassLoader());
+ }
if (clazz.equals (AccessController.class)
&& method.equals ("doPrivileged"))
@@ -226,11 +228,15 @@ final class VMAccessController
* <i>i</i>. The arrays are clean; it will only contain Java methods,
* and no element of the list should be null.
*
- * <p>XXX note: this interface (VMAccessController) would possibly be
- * cleaner if we had a method similar to this, but returned an array
- * of java.lang.reflect.Method objects. Then, instead of having this
- * much logic in this class, we put everything in AccessController,
- * and simply have this single getStack method for a VM to implement.
+ * <p>The default implementation returns an empty stack, which will be
+ * interpreted as having no permissions whatsoever.
+ *
+ * @return A pair of arrays describing the current call stack. The first
+ * element is an array of Class objects, and the second is an array
+ * of Strings comprising the method names.
*/
- private static native Object[][] getStack();
+ private static Object[][] getStack()
+ {
+ return new Object[][] { new Class[0], new String[0] };
+ }
}