Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 53FECF774 for ; Thu, 11 Apr 2013 10:45:32 +0000 (UTC) Received: (qmail 26011 invoked by uid 500); 11 Apr 2013 10:45:31 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 24752 invoked by uid 500); 11 Apr 2013 10:45:26 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 23602 invoked by uid 99); 11 Apr 2013 10:45:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Apr 2013 10:45:24 +0000 Date: Thu, 11 Apr 2013 10:45:24 +0000 (UTC) From: "subes (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CONFIGURATION-540) SystemConfiguration copies System.getProperties() instead of directly using it since 1.8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 subes created CONFIGURATION-540: ----------------------------------- Summary: SystemConfiguration copies System.getProperties() instead of directly using it since 1.8 Key: CONFIGURATION-540 URL: https://issues.apache.org/jira/browse/CONFIGURATION-540 Project: Commons Configuration Issue Type: Bug Affects Versions: 1.9, 1.8 Reporter: subes Priority: Critical In commons-configuration-1.7 the SystemConfiguration directly used the Map of System.getProperties(). Thus when changing the properties inside the SystemConfiguration, the changes were visible in the Map of System.getProperties(). Since commons-configuration-1.8 the SystemConfiguration creates a new Map as a copy of System.getProperties() and thus changes in the SystemConfiguration Map are not visible in the System.getProperties() Map. In 1.7 this super constructor is used by SystemProperties: {quote} public MapConfiguration(Map map) { this.map = map; } {quote} In 1.9 this super constructor is used by SystemProperties: {quote} public MapConfiguration(Properties props) { map = convertPropertiesToMap(props); } {quote} A fix could look like this: {quote} public SystemConfiguration() { super((Map)System.getProperties()); } This breaks the functionality I expected to be able to use SystemConfiguration as a replacement API for accessing and manipulating SystemProperties. For me this is a regression. My workaround is currently not to use: {quote} new SystemConfiguration(); {quote} but instead use: {quote} new MapConfiguration((Map) System.getProperties()); {quote} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira