summaryrefslogtreecommitdiff
path: root/vm/reference/java/lang/VMSecurityManager.java
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2002-02-23 09:19:52 +0000
committerEric Blake <ebb9@byu.net>2002-02-23 09:19:52 +0000
commit70f6e1ec80b4ffc5370564b2710ee194054da42f (patch)
tree9f2b7ce9aa35a53393b9876f6492f2ec90cfde62 /vm/reference/java/lang/VMSecurityManager.java
parente746a862de38f2e1a5d53b17e633ad2400a7e6c8 (diff)
downloadclasspath-70f6e1ec80b4ffc5370564b2710ee194054da42f.tar.gz
2002-02-23 Eric Blake <ebb9@email.byu.edu>
* java/lang/Makefile.am (EXTRA_DIST): Add AssertionError.java and StackTraceElement.java. * java/lang/AssertionError.java: New file. * java/lang/ClassLoader.java: Add some synchronization and code cleanups to use improved VMClassLoader. Add assertion status fields and methods. * java/lang/StackTraceElement.java: New file. * vm/reference/java/lang/Class.java (desiredAssertionStatus): Add. Other locations: clean up code. * vm/reference/java/lang/Throwable.java (cause, stackTrace): Add exception chaining, and Java code for stack traces (native code unimplemented). * vm/reference/java/lang/VMClassLoader.java: Add (unimplemented) hooks to compile assertion status. (defineClass, loadClass): Add prototypes for missing native hooks. * vm/reference/java/lang/VMSecurityManager.java: Formatting. * gnu/java/lang/ClassHelper.java (getAllMethodsAtDeclaration), (getAllFieldsAtDeclaration): Delete, as they were just duplicates. (getAllMethods, getAllFields): Optimize. * gnu/java/lang/ArrayHelper.java: Formatting and Javadoc. (equalsArray): Delete, it duplicates java.util.Arrays.equals. * gnu/java/beans/BeanInfoEmbryo.java (hasMethod): Use Arrays.equals instead of ArrayHelper.equalsArray.
Diffstat (limited to 'vm/reference/java/lang/VMSecurityManager.java')
-rw-r--r--vm/reference/java/lang/VMSecurityManager.java57
1 files changed, 28 insertions, 29 deletions
diff --git a/vm/reference/java/lang/VMSecurityManager.java b/vm/reference/java/lang/VMSecurityManager.java
index bc2ef1382..a70d049d9 100644
--- a/vm/reference/java/lang/VMSecurityManager.java
+++ b/vm/reference/java/lang/VMSecurityManager.java
@@ -1,5 +1,5 @@
-/* VMSecurityManager.java
- Copyright (C) 1998 Free Software Foundation
+/* VMSecurityManager.java -- Reference implementation of VM hooks for security
+ Copyright (C) 1998, 2002 Free Software Foundation
This file is part of GNU Classpath.
@@ -37,33 +37,32 @@ exception statement from your version. */
package java.lang;
-import java.net.*;
-import java.util.*;
-import java.io.*;
-
/**
- ** VMSecurityManager is a helper class for SecurityManager the VM must
- ** implement.
- **
- ** @author John Keiser
- ** @version 1.1.0, 31 May 1998
- **/
-class VMSecurityManager {
- /** Get a list of all the classes currently executing
- ** methods on the Java stack. getClassContext()[0] is
- ** the currently executing method
- ** <STRONG>Spec Note:</STRONG> does not say whether
- ** the stack will include the getClassContext() call or
- ** the one just before it.
- **
- ** @return an array containing all the methods on classes
- ** on the Java execution stack.
- **/
- static native Class[] getClassContext();
+ * VMSecurityManager is a helper class for SecurityManager the VM must
+ * implement.
+ *
+ * @author John Keiser
+ * @author Eric Blake <ebb9@email.byu.edu>
+ */
+final class VMSecurityManager
+{
+ /**
+ * Get a list of all the classes currently executing methods on the
+ * Java stack. getClassContext()[0] is the currently executing method, ie.
+ * the method which called SecurityManager.getClassContext(). (Hint: you
+ * may need to pop off one or more frames: don't include SecurityManager
+ * or VMSecurityManager.getClassContext in your result. Also, be sure that
+ * you correctly handle the context if SecurityManager.getClassContext
+ * was invoked by reflection).
+ *
+ * @return an array of the declaring classes of each stack frame
+ */
+ static native Class[] getClassContext();
- /** Get the current ClassLoader--the one nearest to the
- ** top of the stack.
- ** @return the current ClassLoader.
- **/
- static native ClassLoader currentClassLoader();
+ /**
+ * Get the current ClassLoader--the one nearest to the top of the stack.
+ *
+ * @return the current ClassLoader
+ */
+ static native ClassLoader currentClassLoader();
}