diff options
| author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-28 22:28:09 +0000 |
|---|---|---|
| committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-28 22:28:09 +0000 |
| commit | 5481e0911222c37b664f37cb9f6fbeaadcf15c32 (patch) | |
| tree | e47002eb032121026dab97ad0bcf40039407cde6 /libjava/gnu/java/security/action/GetPropertyAction.java | |
| parent | e1ea7003cdc23e06c069412958725c65abdd1d04 (diff) | |
| download | ppe42-gcc-5481e0911222c37b664f37cb9f6fbeaadcf15c32.tar.gz ppe42-gcc-5481e0911222c37b664f37cb9f6fbeaadcf15c32.zip | |
2004-07-28 Bryce McKinlay <mckinlay@redhat.com>
* gnu/java/security/action/GetPropertyAction.java (setParameters):
Renamed from 'setName'. New 2-argument form with default value.
(run): Pass default 'value' parameter to System.getProperty().
* gnu/java/security/action/SetAccessibleAction.java: Fix javadoc
typos.
* gnu/java/net/protocol/http/Connection.java: Use 'setParameters'
not 'setName'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85274 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/gnu/java/security/action/GetPropertyAction.java')
| -rw-r--r-- | libjava/gnu/java/security/action/GetPropertyAction.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/libjava/gnu/java/security/action/GetPropertyAction.java b/libjava/gnu/java/security/action/GetPropertyAction.java index f40f479bae7..3657254d008 100644 --- a/libjava/gnu/java/security/action/GetPropertyAction.java +++ b/libjava/gnu/java/security/action/GetPropertyAction.java @@ -51,7 +51,8 @@ import java.security.PrivilegedAction; */ public class GetPropertyAction implements PrivilegedAction { - String propName; + String name; + String value = null; public GetPropertyAction() { @@ -59,17 +60,30 @@ public class GetPropertyAction implements PrivilegedAction public GetPropertyAction(String propName) { - this.propName = propName; + setParameters(propName); + } + + public GetPropertyAction(String propName, String defaultValue) + { + setParameters(propName, defaultValue); } public Object run() { - return System.getProperty(propName); + return System.getProperty(name, value); } - public GetPropertyAction setName(String propName) + public GetPropertyAction setParameters(String propName) + { + this.name = propName; + this.value = null; + return this; + } + + public GetPropertyAction setParameters(String propName, String defaultValue) { - this.propName = propName; + this.name = propName; + this.value = defaultValue; return this; } } |

