commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r788054 - in /commons/proper/configuration/branches/configuration2_experimental/src: main/java/org/apache/commons/configuration2/ test/java/org/apache/commons/configuration2/
Date Wed, 24 Jun 2009 15:39:19 GMT
Author: ebourg
Date: Wed Jun 24 15:39:19 2009
New Revision: 788054

URL: http://svn.apache.org/viewvc?rev=788054&view=rev
Log:
Turned PropertiesConfiguration into a hierarchical configuration

Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalFileConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestFileConfiguration.java

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalFileConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalFileConfiguration.java?rev=788054&r1=788053&r2=788054&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalFileConfiguration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalFileConfiguration.java
Wed Jun 24 15:39:19 2009
@@ -106,7 +106,7 @@
     protected ReloadingStrategy strategy;
 
     /** A lock object for protecting reload operations.*/
-    private Object reloadLock = new Object();
+    private final Object reloadLock = new Object();
 
     /** Stores the encoding of the configuration file.*/
     private String encoding;
@@ -911,24 +911,12 @@
         }
     }
 
-    public Object getProperty(String key)
-    {
-        reload();
-        return super.getProperty(key);
-    }
-
     public boolean isEmpty()
     {
         reload();
         return super.isEmpty();
     }
 
-    public boolean containsKey(String key)
-    {
-        reload();
-        return super.containsKey(key);
-    }
-
     public Iterator<String> getKeys()
     {
         reload();

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java?rev=788054&r1=788053&r2=788054&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertiesConfiguration.java
Wed Jun 24 15:39:19 2009
@@ -174,7 +174,7 @@
  * @author <a href="mailto:ebourg@apache.org">Emmanuel Bourg</a>
  * @version $Id$
  */
-public class PropertiesConfiguration extends AbstractFileConfiguration
+public class PropertiesConfiguration extends AbstractHierarchicalFileConfiguration
 {
     /** Constant for the supported comment characters.*/
     static final String COMMENT_CHARS = "#!";

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java?rev=788054&r1=788053&r2=788054&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationBasicFeatures.java
Wed Jun 24 15:39:19 2009
@@ -26,15 +26,11 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.apache.commons.configuration2.AbstractConfiguration;
-import org.apache.commons.configuration2.Configuration;
-import org.apache.commons.configuration2.PropertiesConfiguration;
+import junit.framework.TestCase;
 import org.apache.commons.configuration2.event.ConfigurationEvent;
 import org.apache.commons.configuration2.event.ConfigurationListener;
 import org.apache.commons.configuration2.flat.BaseConfiguration;
 
-import junit.framework.TestCase;
-
 /**
  * A test class for some of the basic functionality implemented by
  * AbstractConfiguration.
@@ -338,7 +334,7 @@
     private AbstractConfiguration setUpDestConfig()
     {
         AbstractConfiguration config = new TestConfigurationImpl(
-                new PropertiesConfiguration());
+                new BaseConfiguration());
         for (int i = 0; i < PROP_COUNT; i++)
         {
             config.addProperty(KEY_PREFIX + i, "value" + i);

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestFileConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestFileConfiguration.java?rev=788054&r1=788053&r2=788054&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestFileConfiguration.java
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestFileConfiguration.java
Wed Jun 24 15:39:19 2009
@@ -560,6 +560,7 @@
     public void testLogErrorListener()
     {
         PropertiesConfiguration config = new PropertiesConfiguration();
+        config.addErrorLogListener();
         assertEquals("No error log listener registered", 1, config
                 .getErrorListeners().size());
     }



Mime
View raw message