From cf6f7d55897e0c6b1badbcfc241e512a4bb154b8 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Tue, 20 Apr 2004 12:30:19 +0000 Subject: Byte.java, [...]: Fixed javadocs, coding style and argument names all over. 2004-04-20 Michael Koch * 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 --- libjava/java/lang/SecurityManager.java | 44 +++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 16 deletions(-) (limited to 'libjava/java/lang/SecurityManager.java') diff --git a/libjava/java/lang/SecurityManager.java b/libjava/java/lang/SecurityManager.java index 8740a2e4287..2e82a475b5f 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); - *
+ * 
* *

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:
+ * will return null in three cases: + * + *

* * @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:
+ * will return null in three cases: + * + *
    *
  • All methods on the stack are from system classes
  • *
  • All methods on the stack up to the first "privileged" caller, as * created by {@link AccessController.doPrivileged(PrivilegedAction)}, * are from system classes
  • *
  • A check of java.security.AllPermission succeeds.
  • - * + *
* * @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:
+ * will return -1 in three cases: + * + *
    *
  • All methods on the stack are from system classes
  • *
  • All methods on the stack up to the first "privileged" caller, as * created by {@link AccessController.doPrivileged(PrivilegedAction)}, * are from system classes
  • *
  • A check of java.security.AllPermission succeeds.
  • - * + *
* * @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 RuntimePermission("modifyThread") on system threads (ie. - * threads in ThreadGroup with a null parent), and returns silently on + * checks RuntimePermission("modifyThread") on system threads + * (ie. threads in ThreadGroup with a null parent), and returns silently on * other threads. * *

If you override this, you must do two things. First, call @@ -375,9 +381,9 @@ public class SecurityManager * RuntimePermission("modifyThread"), 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 RuntimePermission("modifyThread") on the system group (ie. - * the one with a null parent), and returns silently on other groups. + * checks RuntimePermission("modifyThread") on the system group + * (ie. the one with a null parent), and returns silently on other groups. * *

If you override this, you must do two things. First, call * super.checkAccess(t), 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 super.checkPropertyAccess 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) -- cgit v1.2.3