aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/SecurityManager.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2004-04-20 12:30:19 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2004-04-20 12:30:19 +0000
commitcf6f7d55897e0c6b1badbcfc241e512a4bb154b8 (patch)
treed5b22b275323c4e4a0c6ebb05e86b4a087ef279d /libjava/java/lang/SecurityManager.java
parent9f714d5eec05594569dd89920353272606622d8a (diff)
downloadgcc-cf6f7d55897e0c6b1badbcfc241e512a4bb154b8.zip
gcc-cf6f7d55897e0c6b1badbcfc241e512a4bb154b8.tar.gz
gcc-cf6f7d55897e0c6b1badbcfc241e512a4bb154b8.tar.bz2
Byte.java, [...]: Fixed javadocs, coding style and argument names all over.
2004-04-20 Michael Koch <konqueror@gmx.de> * java/lang/Byte.java, java/lang/CharSequence.java, java/lang/ClassLoader.java, java/lang/Compiler.java, java/lang/Double.java, java/lang/Float.java, java/lang/Integer.java, java/lang/Long.java, java/lang/Math.java, java/lang/Number.java, java/lang/Package.java, java/lang/Runtime.java, java/lang/RuntimePermission.java, java/lang/SecurityManager.java, java/lang/Short.java, java/lang/StringBuffer.java, java/lang/System.java, java/lang/ThreadGroup.java, java/lang/Throwable.java, java/lang/reflect/InvocationHandler.java, java/lang/reflect/Proxy.java: Fixed javadocs, coding style and argument names all over. From-SVN: r80899
Diffstat (limited to 'libjava/java/lang/SecurityManager.java')
-rw-r--r--libjava/java/lang/SecurityManager.java44
1 files changed, 28 insertions, 16 deletions
diff --git a/libjava/java/lang/SecurityManager.java b/libjava/java/lang/SecurityManager.java
index 8740a2e..2e82a47 100644
--- a/libjava/java/lang/SecurityManager.java
+++ b/libjava/java/lang/SecurityManager.java
@@ -86,7 +86,7 @@ import java.util.PropertyPermission;
* // now, in worker thread
* if (sm != null)
* sm.checkPermission(permission, context);
- * <pre>
+ * </pre>
*
* <p>Permissions fall into these categories: File, Socket, Net, Security,
* Runtime, Property, AWT, Reflect, and Serializable. Each of these
@@ -174,13 +174,15 @@ public class SecurityManager
* Find the ClassLoader of the first non-system class on the execution
* stack. A non-system class is one whose ClassLoader is not equal to
* {@link ClassLoader#getSystemClassLoader()} or its ancestors. This
- * will return null in three cases:<br><nl>
+ * will return null in three cases:
+ *
+ * <ul>
* <li>All methods on the stack are from system classes</li>
* <li>All methods on the stack up to the first "privileged" caller, as
* created by {@link AccessController.doPrivileged(PrivilegedAction)},
* are from system classes</li>
* <li>A check of <code>java.security.AllPermission</code> succeeds.</li>
- * </nl>
+ * </ul>
*
* @return the most recent non-system ClassLoader on the execution stack
* @deprecated use {@link #checkPermission(Permission)} instead
@@ -194,13 +196,15 @@ public class SecurityManager
* Find the first non-system class on the execution stack. A non-system
* class is one whose ClassLoader is not equal to
* {@link ClassLoader#getSystemClassLoader()} or its ancestors. This
- * will return null in three cases:<br><nl>
+ * will return null in three cases:
+ *
+ * <ul>
* <li>All methods on the stack are from system classes</li>
* <li>All methods on the stack up to the first "privileged" caller, as
* created by {@link AccessController.doPrivileged(PrivilegedAction)},
* are from system classes</li>
* <li>A check of <code>java.security.AllPermission</code> succeeds.</li>
- * </nl>
+ * </ul>
*
* @return the most recent non-system Class on the execution stack
* @deprecated use {@link #checkPermission(Permission)} instead
@@ -231,13 +235,15 @@ public class SecurityManager
* Get the depth on the execution stack of the most recent non-system class.
* A non-system class is one whose ClassLoader is not equal to
* {@link ClassLoader#getSystemClassLoader()} or its ancestors. This
- * will return -1 in three cases:<br><nl>
+ * will return -1 in three cases:
+ *
+ * <ul>
* <li>All methods on the stack are from system classes</li>
* <li>All methods on the stack up to the first "privileged" caller, as
* created by {@link AccessController.doPrivileged(PrivilegedAction)},
* are from system classes</li>
* <li>A check of <code>java.security.AllPermission</code> succeeds.</li>
- * </nl>
+ * </ul>
*
* @return the index of the most recent non-system Class on the stack
* @deprecated use {@link #checkPermission(Permission)} instead
@@ -365,8 +371,8 @@ public class SecurityManager
* Check if the current thread is allowed to modify another Thread. This is
* called by Thread.stop(), suspend(), resume(), interrupt(), destroy(),
* setPriority(), setName(), and setDaemon(). The default implementation
- * checks <code>RuntimePermission("modifyThread") on system threads (ie.
- * threads in ThreadGroup with a null parent), and returns silently on
+ * checks <code>RuntimePermission("modifyThread")</code> on system threads
+ * (ie. threads in ThreadGroup with a null parent), and returns silently on
* other threads.
*
* <p>If you override this, you must do two things. First, call
@@ -375,9 +381,9 @@ public class SecurityManager
* <code>RuntimePermission("modifyThread")</code>, return silently, so that
* core classes (the Classpath library!) can modify any thread.
*
- * @param t the other Thread to check
+ * @param thread the other Thread to check
* @throws SecurityException if permission is denied
- * @throws NullPointerException if t is null
+ * @throws NullPointerException if thread is null
* @see Thread#stop()
* @see Thread#suspend()
* @see Thread#resume()
@@ -385,9 +391,10 @@ public class SecurityManager
* @see Thread#setName(String)
* @see Thread#setDaemon(boolean)
*/
- public void checkAccess(Thread t)
+ public void checkAccess(Thread thread)
{
- if (t.group != null && t.group.getParent() != null)
+ if (thread.getThreadGroup() != null
+ && thread.getThreadGroup().getParent() != null)
checkPermission(new RuntimePermission("modifyThread"));
}
@@ -397,8 +404,8 @@ public class SecurityManager
* ThreadGroup.ThreadGroup() (to add this ThreadGroup to a parent),
* ThreadGroup.stop(), suspend(), resume(), interrupt(), destroy(),
* setDaemon(), and setMaxPriority(). The default implementation
- * checks <code>RuntimePermission("modifyThread") on the system group (ie.
- * the one with a null parent), and returns silently on other groups.
+ * checks <code>RuntimePermission("modifyThread")</code> on the system group
+ * (ie. the one with a null parent), and returns silently on other groups.
*
* <p>If you override this, you must do two things. First, call
* <code>super.checkAccess(t)</code>, to make sure you are not relaxing
@@ -650,13 +657,15 @@ public class SecurityManager
* @param host the host to connect to
* @param port the port to connect on
* @param context the context to determine access for
+ *
* @throws SecurityException if permission is denied, or if context is
* not an AccessControlContext
* @throws NullPointerException if host is null
+ *
* @see #getSecurityContext()
* @see AccessControlContext#checkPermission(Permission)
*/
- public void checkConnect(String host, int port, Object securityContext)
+ public void checkConnect(String host, int port, Object context)
{
// XXX Should be:
// if (! (context instanceof AccessControlContext))
@@ -775,9 +784,12 @@ public class SecurityManager
* you override this, call <code>super.checkPropertyAccess</code> rather
* than throwing an exception.
*
+ * @param key the key of the property to check
+ *
* @throws SecurityException if permission is denied
* @throws NullPointerException if key is null
* @throws IllegalArgumentException if key is ""
+ *
* @see System#getProperty(String)
*/
public void checkPropertyAccess(String key)