diff options
author | Bryce McKinlay <mckinlay@redhat.com> | 2004-07-28 22:28:09 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2004-07-28 23:28:09 +0100 |
commit | 64d696b6da7c76a606484adccc6de38822ac027f (patch) | |
tree | e47002eb032121026dab97ad0bcf40039407cde6 /libjava | |
parent | 1fd0ec3576405da64e9c50637b459c4d65d03c8f (diff) | |
download | gcc-64d696b6da7c76a606484adccc6de38822ac027f.zip gcc-64d696b6da7c76a606484adccc6de38822ac027f.tar.gz gcc-64d696b6da7c76a606484adccc6de38822ac027f.tar.bz2 |
GetPropertyAction.java (setParameters): Renamed from 'setName'.
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'.
From-SVN: r85274
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 10 | ||||
-rw-r--r-- | libjava/gnu/java/net/protocol/http/Connection.java | 4 | ||||
-rw-r--r-- | libjava/gnu/java/security/action/GetPropertyAction.java | 24 | ||||
-rw-r--r-- | libjava/gnu/java/security/action/SetAccessibleAction.java | 4 |
4 files changed, 33 insertions, 9 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index e4de1d0..a1df38a 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,15 @@ 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'. + +2004-07-28 Bryce McKinlay <mckinlay@redhat.com> + * configure.in: Check for minimum GTK version 2.4 requirement. * configure: Rebuilt. diff --git a/libjava/gnu/java/net/protocol/http/Connection.java b/libjava/gnu/java/net/protocol/http/Connection.java index ccae499..e15fda8 100644 --- a/libjava/gnu/java/net/protocol/http/Connection.java +++ b/libjava/gnu/java/net/protocol/http/Connection.java @@ -97,7 +97,7 @@ public final class Connection extends HttpURLConnection if (proxyHost != null) { proxyInUse = true; - getProperty.setName("http.proxyPort"); + getProperty.setParameters("http.proxyPort"); port = (String) AccessController.doPrivileged(getProperty); if (port != null) { @@ -112,7 +112,7 @@ public final class Connection extends HttpURLConnection } } - getProperty.setName("http.agent"); + getProperty.setParameters("http.agent"); userAgent = (String) AccessController.doPrivileged(getProperty); } diff --git a/libjava/gnu/java/security/action/GetPropertyAction.java b/libjava/gnu/java/security/action/GetPropertyAction.java index f40f479..3657254 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; } } diff --git a/libjava/gnu/java/security/action/SetAccessibleAction.java b/libjava/gnu/java/security/action/SetAccessibleAction.java index 810681f..2827a3a 100644 --- a/libjava/gnu/java/security/action/SetAccessibleAction.java +++ b/libjava/gnu/java/security/action/SetAccessibleAction.java @@ -41,13 +41,13 @@ import java.lang.reflect.AccessibleObject; import java.security.PrivilegedAction; /** - * PrivilagedAction implementation that calls setAccessible(true) on the + * PrivilegedAction implementation that calls setAccessible(true) on the * AccessibleObject passed to its constructor. * * Example of use: * <code> * Field dataField = cl.getDeclaredField("data"); - * AccessController.doPrivilaged(new SetAccessibleAction(dataField)); + * AccessController.doPrivileged(new SetAccessibleAction(dataField)); * </code> */ public class SetAccessibleAction implements PrivilegedAction |