This is the mail archive of the
java-patches@sources.redhat.com
mailing list for the Java project.
PATCH: System properties and init_properties
- To: java-patches at sourceware dot cygnus dot com
- Subject: PATCH: System properties and init_properties
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Fri, 24 Nov 2000 18:06:53 +1300
This patch fixes a bug where init_properties() wasn't being called from
setProperty(). It also makes the system properties calls more efficient
by having them only call init_properties in the case where properties is
null.
[ bryce ]
2000-11-24 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/System.java (setProperties): Only call init_properties()
if properties is null.
(getProperties): Ditto.
(getProperty): Ditto.
(setProperty): Call init_properties if properties are null.
Index: System.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/System.java,v
retrieving revision 1.4
diff -u -r1.4 System.java
--- System.java 2000/08/21 06:05:19 1.4
+++ System.java 2000/11/24 04:59:46
@@ -63,7 +63,8 @@
{
if (secman != null)
secman.checkPropertiesAccess();
- init_properties ();
+ if (properties == null)
+ init_properties ();
return properties;
}
@@ -71,7 +72,8 @@
{
if (secman != null)
secman.checkPropertyAccess(property);
- init_properties ();
+ if (properties == null)
+ init_properties ();
return properties.getProperty(property);
}
@@ -79,7 +81,8 @@
{
if (secman != null)
secman.checkPropertyAccess(property, defval);
- init_properties ();
+ if (properties == null)
+ init_properties ();
return properties.getProperty(property, defval);
}
@@ -137,6 +140,8 @@
{
if (secman != null)
secman.checkPermission (new PropertyPermission (key, "write"));
+ if (properties == null)
+ init_properties ();
return (String) properties.setProperty (key, value);
}