From: Tom Tromey Date: Fri, 14 Feb 2003 17:43:34 +0000 (+0000) Subject: System.java (properties): Use Properties.clone. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8c86c6d07a8c404a696d908b0734af9493c0884;p=gcc.git System.java (properties): Use Properties.clone. * java/lang/System.java (properties): Use Properties.clone. (setProperties): Likewise. From-SVN: r62903 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 484b5fccd5e..33a95eb29ca 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2003-02-14 Tom Tromey + + * java/lang/System.java (properties): Use Properties.clone. + (setProperties): Likewise. + 2003-02-14 Michael Koch * gnu/java/nio/natServerSocketChannelImpl.cc: Removed. 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; }