commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1578583 - /commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/BaseHierarchicalConfiguration.java
Date Mon, 17 Mar 2014 21:12:36 GMT
Author: oheger
Date: Mon Mar 17 21:12:36 2014
New Revision: 1578583

URL: http://svn.apache.org/r1578583
Log:
Implemented configurationsAt() in BaseHierarchicalConfiguration.

Modified:
    commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/BaseHierarchicalConfiguration.java

Modified: commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/BaseHierarchicalConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/BaseHierarchicalConfiguration.java?rev=1578583&r1=1578582&r2=1578583&view=diff
==============================================================================
--- commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/BaseHierarchicalConfiguration.java
(original)
+++ commons/proper/configuration/branches/immutableNodes/src/main/java/org/apache/commons/configuration/BaseHierarchicalConfiguration.java
Mon Mar 17 21:12:36 2014
@@ -346,30 +346,26 @@ public class BaseHierarchicalConfigurati
     }
 
     /**
-     * {@inheritDoc} This implementation creates sub configurations in the same way as
-     * described for {@link #configurationAt(String)}.
+     * {@inheritDoc} This implementation creates sub configurations in the same
+     * way as described for {@link #configurationAt(String)}.
      */
-    public List<HierarchicalConfiguration<ImmutableNode>> configurationsAt(String
key)
+    public List<HierarchicalConfiguration<ImmutableNode>> configurationsAt(
+            String key)
     {
-        beginWrite(false);
-        try
-        {
-//            List<ConfigurationNode> nodes = fetchNodeList(key);
-//            List<SubnodeConfiguration> configs =
-//                    new ArrayList<SubnodeConfiguration>(nodes.size());
-//            for (ConfigurationNode node : nodes)
-//            {
-//                configs.add(createAndInitializeSubnodeConfiguration(node, null,
-//                        false));
-//            }
-//            return configs;
-            //TODO implementation
-            return null;
-        }
-        finally
-        {
-            endWrite();
+        List<ImmutableNode> nodes = fetchFilteredNodeResults(key);
+        List<HierarchicalConfiguration<ImmutableNode>> results =
+                new ArrayList<HierarchicalConfiguration<ImmutableNode>>(
+                        nodes.size());
+        for (ImmutableNode node : nodes)
+        {
+            BaseHierarchicalConfiguration sub =
+                    new BaseHierarchicalConfiguration(new InMemoryNodeModel(
+                            node));
+            initSubConfiguration(sub);
+            results.add(sub);
         }
+
+        return results;
     }
 
     /**



Mime
View raw message