commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r788301 - /commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/SystemConfiguration.java
Date Thu, 25 Jun 2009 09:20:45 GMT
Author: ebourg
Date: Thu Jun 25 09:20:44 2009
New Revision: 788301

URL: http://svn.apache.org/viewvc?rev=788301&view=rev
Log:
Changed SystemConfiguration to use ConfigurationUtils.copy() and added the missing @since
tags

Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/SystemConfiguration.java

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/SystemConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/SystemConfiguration.java?rev=788301&r1=788300&r2=788301&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/SystemConfiguration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/SystemConfiguration.java
Thu Jun 25 09:20:44 2009
@@ -17,8 +17,6 @@
 
 package org.apache.commons.configuration2;
 
-import java.util.Iterator;
-
 /**
  * A configuration based on the system properties.
  *
@@ -40,8 +38,10 @@
 
     /**
      * 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
      */
     public static void setSystemProperties(String fileName) throws Exception
     {
@@ -50,9 +50,11 @@
 
     /**
      * 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.
+     * @since 1.6
      */
     public static void setSystemProperties(String basePath, String fileName) throws Exception
     {
@@ -69,16 +71,12 @@
 
     /**
      * 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)
     {
-        Iterator iter = systemConfig.getKeys();
-        while (iter.hasNext())
-        {
-            String key = (String) iter.next();
-            String value = (String) systemConfig.getProperty(key);
-            System.setProperty(key, value);
-        }
+        ConfigurationUtils.copy(systemConfig, new SystemConfiguration());
     }
 }



Mime
View raw message