This is the mail archive of the java-patches@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: System properties and init_properties


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);
   }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]