Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 55265 invoked from network); 27 Sep 2009 20:58:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Sep 2009 20:58:30 -0000 Received: (qmail 498 invoked by uid 500); 27 Sep 2009 20:58:29 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 403 invoked by uid 500); 27 Sep 2009 20:58:29 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 392 invoked by uid 99); 27 Sep 2009 20:58:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Sep 2009 20:58:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Sep 2009 20:58:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B62162388904; Sun, 27 Sep 2009 20:58:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r819402 - /commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/SystemConfiguration.java Date: Sun, 27 Sep 2009 20:58:07 -0000 To: commits@commons.apache.org From: rgoers@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090927205807.B62162388904@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rgoers Date: Sun Sep 27 20:58:07 2009 New Revision: 819402 URL: http://svn.apache.org/viewvc?rev=819402&view=rev Log: Revert prior change. For some reason using ConfigurationUtils.copy() causes all sorts of problems when DefaultConfigurationBuilder is performing this operation on JBoss. Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/SystemConfiguration.java Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/SystemConfiguration.java URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/SystemConfiguration.java?rev=819402&r1=819401&r2=819402&view=diff ============================================================================== --- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/SystemConfiguration.java (original) +++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/SystemConfiguration.java Sun Sep 27 20:58:07 2009 @@ -17,6 +17,11 @@ package org.apache.commons.configuration; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.util.Iterator; + /** * A configuration based on the system properties. * @@ -26,6 +31,7 @@ */ public class SystemConfiguration extends MapConfiguration { + private static Log log = LogFactory.getLog(SystemConfiguration.class); /** * Create a Configuration based on the system properties. * @@ -38,7 +44,6 @@ /** * The method allows system properties to be set from a property file. - * * @param fileName The name of the property file. * @throws Exception if an error occurs. * @since 1.6 @@ -50,7 +55,6 @@ /** * The method allows system properties to be set from a property file. - * * @param basePath The base path to look for the property file. * @param fileName The name of the property file. * @throws Exception if an error occurs. @@ -71,12 +75,21 @@ /** * Set System properties from a configuration file. - * * @param systemConfig The configuration containing the properties to be set. * @since 1.6 */ public static void setSystemProperties(PropertiesConfiguration systemConfig) { - ConfigurationUtils.copy(systemConfig, new SystemConfiguration()); + Iterator iter = systemConfig.getKeys(); + while (iter.hasNext()) + { + String key = (String) iter.next(); + String value = (String) systemConfig.getProperty(key); + if (log.isDebugEnabled()) + { + log.debug("Setting system property " + key + " to " + value); + } + System.setProperty(key, value); + } } }