+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.
if (proxyHost != null)
{
proxyInUse = true;
- getProperty.setName("http.proxyPort");
+ getProperty.setParameters("http.proxyPort");
port = (String) AccessController.doPrivileged(getProperty);
if (port != null)
{
}
}
- getProperty.setName("http.agent");
+ getProperty.setParameters("http.agent");
userAgent = (String) AccessController.doPrivileged(getProperty);
}
*/
public class GetPropertyAction implements PrivilegedAction
{
- String propName;
+ String name;
+ String value = null;
public GetPropertyAction()
{
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;
}
}
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