diff options
author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-26 07:11:10 +0000 |
---|---|---|
committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-26 07:11:10 +0000 |
commit | aa6675156c2e6175abea3611ba5cda7398d61bc6 (patch) | |
tree | f6b6ed6e1ea7dd1bbbbe2c4565307106b5c22b95 /libjava/gnu/java | |
parent | 7da8b58097bd9929d9f038dd97d20ba7c53692c9 (diff) | |
download | gcc-aa6675156c2e6175abea3611ba5cda7398d61bc6.tar.gz |
2005-04-26 Jeroen Frijters <jeroen@frijters.net>
* gnu/java/security/action/GetSecurityPropertyAction.java
(GetSecurityPropertyAction): Implement PrivilegedAction instead
of extending GetPropertyAction.
(name): New field.
(value): Likewise.
(setParamters): New methods.
(GetSecurityPropertyAction): Use new setParameters methods.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98765 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java')
-rw-r--r-- | libjava/gnu/java/security/action/GetSecurityPropertyAction.java | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/libjava/gnu/java/security/action/GetSecurityPropertyAction.java b/libjava/gnu/java/security/action/GetSecurityPropertyAction.java index 01aab81d9c8..b61e9c836d6 100644 --- a/libjava/gnu/java/security/action/GetSecurityPropertyAction.java +++ b/libjava/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; |