You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by eb...@apache.org on 2009/06/25 11:20:45 UTC
svn commit: r788301 -
/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/SystemConfiguration.java
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());
}
}