You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by oh...@apache.org on 2011/11/26 17:56:46 UTC
svn commit: r1206493 -
/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/xpath/ConfigurationNodeIteratorChildren.java
Author: oheger
Date: Sat Nov 26 16:56:42 2011
New Revision: 1206493
URL: http://svn.apache.org/viewvc?rev=1206493&view=rev
Log:
Java 1.5 compatibility: Javadocs, raw types.
Modified:
commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/xpath/ConfigurationNodeIteratorChildren.java
Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/xpath/ConfigurationNodeIteratorChildren.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/xpath/ConfigurationNodeIteratorChildren.java?rev=1206493&r1=1206492&r2=1206493&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/xpath/ConfigurationNodeIteratorChildren.java (original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/xpath/ConfigurationNodeIteratorChildren.java Sat Nov 26 16:56:42 2011
@@ -18,7 +18,6 @@ package org.apache.commons.configuration
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import org.apache.commons.configuration.tree.ConfigurationNode;
@@ -35,13 +34,15 @@ import org.apache.commons.lang.StringUti
* node.
*
* @since 1.3
- * @author Oliver Heger
+ * @author <a
+ * href="http://commons.apache.org/configuration/team-list.html">Commons
+ * Configuration team</a>
* @version $Id$
*/
class ConfigurationNodeIteratorChildren extends ConfigurationNodeIteratorBase
{
/**
- * Creates a new instance of <code>ConfigurationNodeIteratorChildren</code>
+ * Creates a new instance of {@code ConfigurationNodeIteratorChildren}
* and initializes it.
*
* @param parent the parent pointer
@@ -54,7 +55,7 @@ class ConfigurationNodeIteratorChildren
{
super(parent, reverse);
ConfigurationNode root = (ConfigurationNode) parent.getNode();
- List childNodes = createSubNodeList(root, nodeTest);
+ List<ConfigurationNode> childNodes = createSubNodeList(root, nodeTest);
initSubNodeList(childNodes);
if (startsWith != null)
{
@@ -72,9 +73,9 @@ class ConfigurationNodeIteratorChildren
* @param test the test object
* @return a list with the matching nodes
*/
- protected List createSubNodeList(ConfigurationNode node, NodeTest test)
+ protected List<ConfigurationNode> createSubNodeList(ConfigurationNode node, NodeTest test)
{
- List children = node.getChildren();
+ List<ConfigurationNode> children = node.getChildren();
if (test == null)
{
@@ -93,10 +94,9 @@ class ConfigurationNodeIteratorChildren
return children;
}
- List result = new ArrayList();
- for (Iterator it = children.iterator(); it.hasNext();)
+ List<ConfigurationNode> result = new ArrayList<ConfigurationNode>();
+ for (ConfigurationNode child : children)
{
- ConfigurationNode child = (ConfigurationNode) it.next();
if (StringUtils.equals(name.getName(), child.getName()))
{
result.add(child);
@@ -117,7 +117,7 @@ class ConfigurationNodeIteratorChildren
}
}
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
/**