diff options
| author | Jeroen Frijters <jeroen@sumatra.nl> | 2004-12-06 20:43:12 +0000 |
|---|---|---|
| committer | Jeroen Frijters <jeroen@sumatra.nl> | 2004-12-06 20:43:12 +0000 |
| commit | 3bdd7371262360c0f91635f901ec6bc06f7f3b5a (patch) | |
| tree | 17c115df1772470160f1af810c70f74b25a424e1 /gnu/java/security/action/GetSecurityPropertyAction.java | |
| parent | 130cc65919ab367ca858fb666973b07f2eec5f45 (diff) | |
| download | classpath-3bdd7371262360c0f91635f901ec6bc06f7f3b5a.tar.gz | |
2004-12-06 Jeroen Frijters <jeroen@frijters.net>
* gnu/classpath/SystemProperties.java: New file.
* vm/reference/gnu/classpath/VMSystemProperties.java: New file.
* gnu/java/io/EncodingManager.java,
gnu/java/net/protocol/file/Connection.java,
java/io/File.java,
java/lang/Throwable.java,
java/security/Security.java,
java/security/cert/X509CRLSelector.java,
java/security/cert/X509CertSelector.java,
java/util/Locale.java,
vm/reference/java/lang/VMClassLoader.java:
Modified to use SystemProperties.
* java/lang/Class.java: Modified to use SecurityManager.current.
* java/lang/ClassLoader.java
(StaticData.systemClassLoader): New field.
(StaticData.static): New static initializer to install default
security manager.
(ClassLoader()): Modified to use StaticData.systemClassLoader.
ClassLoader(ClassLoader)): Modified to use SecurityManager.current.
(findSystemClass): Modified to use StaticData.systemClassLoader.
(getParent): Modified to use SecurityManager.current.
(getSystemResource,getSystemResources): Modified to use
StaticData.systemClassLoader.
(getSystemClassLoader): Modified to use SecurityManager.current and
StaticData.systemClassLoader.
(getExtClassLoaderUrls,getSystemClassLoaderUrls): Modified to use
SystemProperties.
(defaultGetSystemClassLoader): Modified to use SecurityManager.current
and SystemProperties.
(getSystemProperty): Removed.
* java/lang/Runtime.java
(securityManager): Removed.
(defaultProperties): Removed.
(static): Removed.
(Runtime): Modified to use SystemProperties.
(exit,removeShutdownHook,halt,runFinalizersOnExit,exec,load,loadLib):
Modified to use SecurityManager.current.
(loadLibrary): Modified to use SecurityManager.current and changed
call to System.mapLibraryName to VMRuntime.mapLibraryName.
* java/lang/SecurityManager.java
(current): New field.
* java/lang/System.java
(systemClassLoader): Removed.
(properties): Removed.
(in,out,err): Initialize in-line.
(static): Removed.
(initLoadLibrary): Removed.
(initProperties): Removed.
(initSystemClassLoader): Removed.
(initSecurityManager): Removed.
(setIn,setOut,setErr,setSecurityManager,getSecurityManager,getenv):
Modified to use SecurityManager.current.
(getProperties,setProperties,getProperty(String),
getProperty(String,String),setProperty): Modified to use
SecurityManager.current and SystemProperties.
(mapLibraryName): Modified to call VMRuntime.mapLibraryName.
* java/lang/Thread.java: Modified to use SecurityManager.current.
* java/lang/ThreadGroup.java: Modified to use SecurityManager.current.
* native/jni/java-lang/java_lang_VMSystem.c
(Java_java_lang_VMSystem_isWordsBigEndian): Removed.
* vm/reference/java/lang/VMRuntime.java
(nativeGetLibname): Removed (renamed to mapLibraryName).
(mapLibraryName): New method.
(insertSystemProperties): Removed.
* vm/reference/java/lang/VMSystem.java
(isWordsBigEndian): Removed.
Diffstat (limited to 'gnu/java/security/action/GetSecurityPropertyAction.java')
| -rw-r--r-- | gnu/java/security/action/GetSecurityPropertyAction.java | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/gnu/java/security/action/GetSecurityPropertyAction.java b/gnu/java/security/action/GetSecurityPropertyAction.java index 01aab81d9..b61e9c836 100644 --- a/gnu/java/security/action/GetSecurityPropertyAction.java +++ b/gnu/java/security/action/GetSecurityPropertyAction.java @@ -50,25 +50,42 @@ import java.security.Security; * String passwd = AccessController.doPrivileged(action); * </code> */ -public class GetSecurityPropertyAction extends GetPropertyAction +public class GetSecurityPropertyAction implements PrivilegedAction { + private String name; + private String value; + public GetSecurityPropertyAction() { } - public GetSecurityPropertyAction (String propName) + public GetSecurityPropertyAction(String propName) { - super (propName); + setParameters(propName); } public GetSecurityPropertyAction(String propName, String defaultValue) { - super (propName, defaultValue); + setParameters(propName, defaultValue); + } + + public GetSecurityPropertyAction setParameters(String propName) + { + this.name = propName; + this.value = null; + return this; + } + + public GetSecurityPropertyAction setParameters(String propName, String defaultValue) + { + this.name = propName; + this.value = defaultValue; + return this; } public Object run() { - String val = Security.getProperty (name); + String val = Security.getProperty(name); if (val == null) val = value; return val; |
