diff options
author | Michael Koch <konqueror@gmx.de> | 2005-04-25 20:35:17 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2005-04-25 20:35:17 +0000 |
commit | 4b30c6bda06ac549212f96617c4c3e171e56876a (patch) | |
tree | ec38f37fff1c149be7ad3e52f4c403a76e3a1733 /libjava/java/lang/Runtime.java | |
parent | 1f4ea3f2fa3915f2c576a8748c9067e49f35057f (diff) | |
download | gcc-4b30c6bda06ac549212f96617c4c3e171e56876a.zip gcc-4b30c6bda06ac549212f96617c4c3e171e56876a.tar.gz gcc-4b30c6bda06ac549212f96617c4c3e171e56876a.tar.bz2 |
Runtime.java, [...]: Replaced java.lang.Runtime.securityManager by java.lang.SecurityManager.current...
2005-04-25 Michael Koch <konqueror@gmx.de>
* java/lang/Runtime.java,
java/lang/SecurityManager.java,
java/lang/System.java,
java/lang/ThreadGroup.java:
Replaced java.lang.Runtime.securityManager by
java.lang.SecurityManager.current (as used in GNU classpath).
From-SVN: r98738
Diffstat (limited to 'libjava/java/lang/Runtime.java')
-rw-r--r-- | libjava/java/lang/Runtime.java | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/libjava/java/lang/Runtime.java b/libjava/java/lang/Runtime.java index 858b331..7a0c598 100644 --- a/libjava/java/lang/Runtime.java +++ b/libjava/java/lang/Runtime.java @@ -65,14 +65,6 @@ public class Runtime */ private final String[] libpath; - /** - * The current security manager. This is located here instead of in - * System, to avoid security problems, as well as bootstrap issues. - * Make sure to access it in a thread-safe manner; it is package visible - * to avoid overhead in java.lang. - */ - static SecurityManager securityManager; - static { init(); @@ -151,7 +143,7 @@ public class Runtime */ public void exit(int status) { - SecurityManager sm = securityManager; // Be thread-safe! + SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkExit(status); boolean first = false; @@ -279,7 +271,7 @@ public class Runtime */ public void addShutdownHook(Thread hook) { - SecurityManager sm = securityManager; // Be thread-safe! + SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkPermission(new RuntimePermission("shutdownHooks")); if (hook.isAlive() || hook.getThreadGroup() == null) @@ -313,7 +305,7 @@ public class Runtime */ public boolean removeShutdownHook(Thread hook) { - SecurityManager sm = securityManager; // Be thread-safe! + SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkPermission(new RuntimePermission("shutdownHooks")); synchronized (libpath) @@ -340,7 +332,7 @@ public class Runtime */ public void halt(int status) { - SecurityManager sm = securityManager; // Be thread-safe! + SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkExit(status); exitInternal(status); @@ -364,7 +356,7 @@ public class Runtime */ public static void runFinalizersOnExit(boolean finalizeOnExit) { - SecurityManager sm = securityManager; // Be thread-safe! + SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkExit(0); current.finalizeOnExit = finalizeOnExit; @@ -494,7 +486,7 @@ public class Runtime public Process exec(String[] cmd, String[] env, File dir) throws IOException { - SecurityManager sm = securityManager; // Be thread-safe! + SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkExec(cmd[0]); return execInternal(cmd, env, dir); @@ -581,7 +573,7 @@ public class Runtime */ public void load(String filename) { - SecurityManager sm = securityManager; // Be thread-safe! + SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkLink(filename); _load(filename, false); @@ -611,7 +603,7 @@ public class Runtime { // This is different from the Classpath implementation, but I // believe it is more correct. - SecurityManager sm = securityManager; // Be thread-safe! + SecurityManager sm = SecurityManager.current; // Be thread-safe! if (sm != null) sm.checkLink(libname); _load(libname, true); |