diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-14 17:43:34 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-14 17:43:34 +0000 |
commit | 5a8d56a084c2a445cd5a53dee2ada6604a94ba8b (patch) | |
tree | ff158a0de62d780ebbd22ef8279308a52bcff5d0 /libjava/java | |
parent | 7b6408ee9b33eb3acc86ae63e3cf9e847d21a904 (diff) | |
download | ppe42-gcc-5a8d56a084c2a445cd5a53dee2ada6604a94ba8b.tar.gz ppe42-gcc-5a8d56a084c2a445cd5a53dee2ada6604a94ba8b.zip |
* java/lang/System.java (properties): Use Properties.clone.
(setProperties): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62903 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/lang/System.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libjava/java/lang/System.java b/libjava/java/lang/System.java index ab584250749..2e7c031b16c 100644 --- a/libjava/java/lang/System.java +++ b/libjava/java/lang/System.java @@ -1,5 +1,5 @@ /* System.java -- useful methods to interface with the system - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -104,8 +104,10 @@ public final class System * {@link #setProperties(Properties)}, but will never be null, because * setProperties(null) sucks in the default properties. */ + // Note that we use clone here and not new. Some programs assume + // that the system properties do not have a parent. private static Properties properties - = new Properties(Runtime.defaultProperties); + = (Properties) Runtime.defaultProperties.clone(); /** * The standard InputStream. This is assigned at startup and starts its @@ -369,7 +371,11 @@ public final class System if (sm != null) sm.checkPropertiesAccess(); if (properties == null) - properties = new Properties(Runtime.defaultProperties); + { + // Note that we use clone here and not new. Some programs + // assume that the system properties do not have a parent. + properties = (Properties) Runtime.defaultProperties.clone(); + } System.properties = properties; } |