diff options
| author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-26 01:48:04 +0000 |
|---|---|---|
| committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-26 01:48:04 +0000 |
| commit | 225627d7c6bf030c419f926e56c45660dbd5bb9d (patch) | |
| tree | 4eaca964f2a13f025b0393ee000372ef3380e323 /libjava/java/lang/System.java | |
| parent | ace65efdcf04e82460a38b314b7341a795cb16c4 (diff) | |
| download | gcc-225627d7c6bf030c419f926e56c45660dbd5bb9d.tar.gz | |
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.
(prop_init): Remove field.
* java/lang/natSystem.cc (init_properties): Synchronize the entire
method. Check for null properties after synchronizing instead of
prop_init flag. Set the properties field last for thread safety.
* java/io/ObjectInputStream.java (ObjectInputStream): If DEBUG is set,
test for gcj.dumpobjects property and enable object stream dumping
if it is set.
(dumpElement): No longer native.
(dumpElementln): Ditto.
(setDump): Do not define.
* java/io/natObjectInputStream.cc (dumpElement): Removed.
(dumpElementln): Removed.
(setDump): Removed.
2000-11-24 Bryce McKinlay <bryce@albatross.co.nz>
* configure: Rebuilt.
* Makefile.in: Rebuilt.
* Makefile.am (built_java_source_files): Add Configuration.java.
* configure.in: Add Configuration.java to CONFIG_FILES. Set
LIBGCJDEBUG substitution if --enable-libgcj-debug is specified.
Create `gnu' directory in the build tree.
* gnu/classpath/Configuration.java.in: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37749 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/lang/System.java')
| -rw-r--r-- | libjava/java/lang/System.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libjava/java/lang/System.java b/libjava/java/lang/System.java index 52dbe75988e..59787099d07 100644 --- a/libjava/java/lang/System.java +++ b/libjava/java/lang/System.java @@ -63,7 +63,8 @@ public final class System { if (secman != null) secman.checkPropertiesAccess(); - init_properties (); + if (properties == null) + init_properties (); return properties; } @@ -71,7 +72,8 @@ public final class System { if (secman != null) secman.checkPropertyAccess(property); - init_properties (); + if (properties == null) + init_properties (); return properties.getProperty(property); } @@ -79,7 +81,8 @@ public final class System { if (secman != null) secman.checkPropertyAccess(property, defval); - init_properties (); + if (properties == null) + init_properties (); return properties.getProperty(property, defval); } @@ -128,15 +131,18 @@ public final class System { if (secman != null) secman.checkPropertiesAccess(); - // We might not have initialized yet. - prop_init = true; - properties = props; + synchronized (System.class) + { + properties = props; + } } public static String setProperty (String key, String value) { if (secman != null) secman.checkPermission (new PropertyPermission (key, "write")); + if (properties == null) + init_properties (); return (String) properties.setProperty (key, value); } @@ -165,7 +171,4 @@ public final class System // Private data. private static SecurityManager secman = null; private static Properties properties = null; - // This boolean is only required for 1.1 and earlier. After 1.1, a - // null properties should always be re-initialized. - private static boolean prop_init = false; } |
