aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu/java
diff options
context:
space:
mode:
authorJeroen Frijters <jeroen@frijters.net>2005-04-26 07:11:10 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2005-04-26 07:11:10 +0000
commit6f3a3283f29f4c0286f485f3f21fd424884c527e (patch)
treef6b6ed6e1ea7dd1bbbbe2c4565307106b5c22b95 /libjava/gnu/java
parenta79f940af0108488561f9d02c718aea1f6ae044b (diff)
downloadgcc-6f3a3283f29f4c0286f485f3f21fd424884c527e.zip
gcc-6f3a3283f29f4c0286f485f3f21fd424884c527e.tar.gz
gcc-6f3a3283f29f4c0286f485f3f21fd424884c527e.tar.bz2
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. From-SVN: r98765
Diffstat (limited to 'libjava/gnu/java')
-rw-r--r--libjava/gnu/java/security/action/GetSecurityPropertyAction.java27
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 01aab81..b61e9c8 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;