commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r786440 - in /commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2: ./ base/ beanutils/ combined/ event/ expr/xpath/ resolver/ tree/ web/
Date Fri, 19 Jun 2009 10:35:02 GMT
Author: ebourg
Date: Fri Jun 19 10:35:01 2009
New Revision: 786440

URL: http://svn.apache.org/viewvc?rev=786440&view=rev
Log:
Minor syntax changes (foreach, generics, redundant casts)

Modified:
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java
    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/CombinedConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CompositeConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DataConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfigurationConverter.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfigurationXMLReader.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/MultiFileHierarchicalConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PatternSubtreeConfigurationWrapper.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertiesConfigurationLayout.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/SubnodeConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/AbstractHierarchicalConfigurationSource.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/BeanHelper.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/XMLBeanDeclaration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/combined/DynamicCombinedConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/event/EventSource.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/expr/xpath/ConfigurationNodePointerFactory.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/CatalogResolver.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/DefaultEntityResolver.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/NodeCombiner.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/ViewNode.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/web/AppletConfiguration.java

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java Fri Jun 19 10:35:01 2009
@@ -629,9 +629,8 @@
          * Each token is of the form 'key=value'.
          */
         Properties props = defaults == null ? new Properties() : new Properties(defaults);
-        for (int i = 0; i < tokens.length; i++)
+        for (String token : tokens)
         {
-            String token = tokens[i];
             int equalSign = token.indexOf('=');
             if (equalSign > 0)
             {

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalConfiguration.java Fri Jun 19 10:35:01 2009
@@ -806,8 +806,7 @@
         // Create missing nodes on the path
         for (String nodeName : data.getPathNodes())
         {
-            T child = createNode(node, nodeName);
-            node = child;
+            node = createNode(node, nodeName);
         }
 
         // Add the new property
@@ -837,8 +836,7 @@
         }
         else
         {
-            T child = createNode(parent, name, value);
-            return child;
+            return createNode(parent, name, value);
         }
     }
 
@@ -952,7 +950,7 @@
         @Override
         public void visitBeforeChildren(T node, NodeHandler<T> handler)
         {
-            String parentKey = parentKeys.isEmpty() ? null : (String) parentKeys.peek();
+            String parentKey = parentKeys.isEmpty() ? null : parentKeys.peek();
             String key = getExpressionEngine().nodeKey(node, parentKey, handler);
             parentKeys.push(key);
             if (handler.getValue(node) != null)

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=786440&r1=786439&r2=786440&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 Fri Jun 19 10:35:01 2009
@@ -315,7 +315,7 @@
     }
 
     @Override
-    public Iterator getKeys()
+    public Iterator<String> getKeys()
     {
         reload();
         return super.getKeys();

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CombinedConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CombinedConfiguration.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CombinedConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CombinedConfiguration.java Fri Jun 19 10:35:01 2009
@@ -379,7 +379,7 @@
      */
     public Configuration getConfiguration(int index)
     {
-        ConfigData cd = (ConfigData) configurations.get(index);
+        ConfigData cd = configurations.get(index);
         return cd.getConfiguration();
     }
 
@@ -392,7 +392,7 @@
      */
     public Configuration getConfiguration(String name)
     {
-        return (Configuration) namedConfigurations.get(name);
+        return namedConfigurations.get(name);
     }
 
 
@@ -438,7 +438,7 @@
     {
         for (int index = 0; index < getNumberOfConfigurations(); index++)
         {
-            if (((ConfigData) configurations.get(index)).getConfiguration() == config)
+            if ((configurations.get(index)).getConfiguration() == config)
             {
                 removeConfigurationAt(index);
                 return true;
@@ -456,7 +456,7 @@
      */
     public Configuration removeConfigurationAt(int index)
     {
-        ConfigData cd = (ConfigData) configurations.remove(index);
+        ConfigData cd = configurations.remove(index);
         if (cd.getName() != null)
         {
             namedConfigurations.remove(cd.getName());
@@ -688,10 +688,10 @@
             ConfigurationNode node = it.next().getTransformedRoot();
             while (it.hasNext())
             {
-                node = getNodeCombiner().combine(node,
-                        ((ConfigData) it.next()).getTransformedRoot());
+                node = getNodeCombiner().combine(node, it.next().getTransformedRoot());
             }
-             if (getLogger().isLoggable(Level.FINEST))
+            
+            if (getLogger().isLoggable(Level.FINEST))
             {
                 ByteArrayOutputStream os = new ByteArrayOutputStream();
                 PrintStream stream = new PrintStream(os);

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CompositeConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CompositeConfiguration.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CompositeConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CompositeConfiguration.java Fri Jun 19 10:35:01 2009
@@ -334,7 +334,7 @@
      */
     public Configuration getConfiguration(int index)
     {
-        return (Configuration) configList.get(index);
+        return configList.get(index);
     }
 
     /**
@@ -478,8 +478,7 @@
      * @param key the key of the property
      * @param <E> the type of the elements in the list
      */
-    private static <E> void appendListProperty(List<E> dest, Configuration config,
-            String key)
+    private static <E> void appendListProperty(List<E> dest, Configuration config, String key)
     {
         Object value = config.getProperty(key);
         if (value != null)

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DataConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DataConfiguration.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DataConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DataConfiguration.java Fri Jun 19 10:35:01 2009
@@ -1108,7 +1108,7 @@
      */
     public URL getURL(String key)
     {
-        return (URL) get(URL.class, key);
+        return get(URL.class, key);
     }
 
     /**
@@ -1125,7 +1125,7 @@
      */
     public URL getURL(String key, URL defaultValue)
     {
-        return (URL) get(URL.class, key, defaultValue);
+        return get(URL.class, key, defaultValue);
     }
 
     /**
@@ -1205,7 +1205,7 @@
      */
     public Date getDate(String key)
     {
-        return (Date) get(Date.class, key);
+        return get(Date.class, key);
     }
 
     /**
@@ -1502,7 +1502,7 @@
      */
     public Calendar getCalendar(String key)
     {
-        return (Calendar) get(Calendar.class, key);
+        return get(Calendar.class, key);
     }
 
     /**
@@ -1808,7 +1808,7 @@
      */
     public Locale getLocale(String key)
     {
-        return (Locale) get(Locale.class, key);
+        return get(Locale.class, key);
     }
 
     /**
@@ -1825,7 +1825,7 @@
      */
     public Locale getLocale(String key, Locale defaultValue)
     {
-        return (Locale) get(Locale.class, key, defaultValue);
+        return get(Locale.class, key, defaultValue);
     }
 
     /**
@@ -1904,7 +1904,7 @@
      */
     public Color getColor(String key)
     {
-        return (Color) get(Color.class, key);
+        return get(Color.class, key);
     }
 
     /**
@@ -1921,7 +1921,7 @@
      */
     public Color getColor(String key, Color defaultValue)
     {
-        return (Color) get(Color.class, key, defaultValue);
+        return get(Color.class, key, defaultValue);
     }
 
     /**

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java Fri Jun 19 10:35:01 2009
@@ -535,7 +535,7 @@
      */
     public ConfigurationProvider removeConfigurationProvider(String tagName)
     {
-        return (ConfigurationProvider) providers.remove(tagName);
+        return providers.remove(tagName);
     }
 
     /**
@@ -547,7 +547,7 @@
      */
     public ConfigurationProvider providerForTag(String tagName)
     {
-        return (ConfigurationProvider) providers.get(tagName);
+        return providers.get(tagName);
     }
 
     /**
@@ -652,10 +652,10 @@
             List<? extends AbstractHierarchicalConfiguration<ConfigurationNode>> containedConfigs,
             String keyListNodes) throws ConfigurationException
     {
-        List<?> listNodes = getList(keyListNodes);
-        for (Iterator<?> it = listNodes.iterator(); it.hasNext();)
+        List<String> listNodes = getList(keyListNodes);
+        for (String node : listNodes)
         {
-            config.getNodeCombiner().addListNode((String) it.next());
+            config.getNodeCombiner().addListNode(node);
         }
 
         for (AbstractHierarchicalConfiguration<ConfigurationNode> conf : containedConfigs)
@@ -664,8 +664,7 @@
             AbstractConfiguration newConf = createConfigurationAt(decl);
             if (newConf != null)
             {
-                config.addConfiguration(newConf, decl.getConfiguration()
-                        .getString(ATTR_NAME), decl.getAt());
+                config.addConfiguration(newConf, decl.getConfiguration().getString(ATTR_NAME), decl.getAt());
             }
         }
     }
@@ -1667,7 +1666,7 @@
         @Override
         public AbstractConfiguration getConfiguration(ConfigurationDeclaration decl) throws Exception
         {
-            Map<?, ?> attributes = decl.getBeanProperties();
+            Map<String, ?> attributes = decl.getBeanProperties();
             String jndi = (String) attributes.get("jndi");
             DataSource datasource = (DataSource) new InitialContext().lookup(jndi);
 

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfiguration.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfiguration.java Fri Jun 19 10:35:01 2009
@@ -1102,7 +1102,7 @@
         @Override
         public void visitBeforeChildren(ConfigurationNode node)
         {
-            String parentKey = parentKeys.isEmpty() ? null : (String) parentKeys.peek();
+            String parentKey = parentKeys.isEmpty() ? null : parentKeys.peek();
             String key = getExpressionEngine().nodeKey(node, parentKey);
             parentKeys.push(key);
             if (node.getValue() != null)

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfigurationConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfigurationConverter.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfigurationConverter.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfigurationConverter.java Fri Jun 19 10:35:01 2009
@@ -186,9 +186,9 @@
     {
         if (value != null && value instanceof Collection)
         {
-            for (Iterator it = ((Collection) value).iterator(); it.hasNext();)
+            for (Object element : ((Collection) value))
             {
-                fireValue(name, it.next());
+                fireValue(name, element);
             }
         }
         else

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfigurationXMLReader.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfigurationXMLReader.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfigurationXMLReader.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/HierarchicalConfigurationXMLReader.java Fri Jun 19 10:35:01 2009
@@ -130,7 +130,6 @@
          * Visits the specified node.
          *
          * @param node the actual node
-         * @param key the key of this node
          */
         @Override
         public void visitBeforeChildren(ConfigurationNode node)

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/MultiFileHierarchicalConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/MultiFileHierarchicalConfiguration.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/MultiFileHierarchicalConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/MultiFileHierarchicalConfiguration.java Fri Jun 19 10:35:01 2009
@@ -16,32 +16,31 @@
  */
 package org.apache.commons.configuration2;
 
+import java.io.File;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Reader;
+import java.io.Writer;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.net.URL;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
-import java.util.Collection;
-import java.util.logging.Logger;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import java.net.URL;
-import java.io.Writer;
-import java.io.Reader;
-import java.io.File;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.util.logging.Logger;
 
-import org.apache.commons.configuration2.event.ConfigurationListener;
-import org.apache.commons.configuration2.event.ConfigurationErrorListener;
+import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.configuration2.event.ConfigurationErrorEvent;
+import org.apache.commons.configuration2.event.ConfigurationErrorListener;
 import org.apache.commons.configuration2.event.ConfigurationEvent;
+import org.apache.commons.configuration2.event.ConfigurationListener;
 import org.apache.commons.configuration2.expr.ExpressionEngine;
-import org.apache.commons.configuration2.tree.ConfigurationNode;
-import org.apache.commons.configuration2.tree.TreeUtils;
 import org.apache.commons.configuration2.reloading.ReloadingStrategy;
 import org.apache.commons.configuration2.resolver.EntityResolverSupport;
-import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.configuration2.tree.ConfigurationNode;
 import org.xml.sax.EntityResolver;
 
 /**
@@ -488,7 +487,7 @@
     }
 
     @Override
-    public Collection getConfigurationListeners()
+    public Collection<ConfigurationListener> getConfigurationListeners()
     {
         return super.getConfigurationListeners();
     }
@@ -518,7 +517,7 @@
     }
 
     @Override
-    public Collection getErrorListeners()
+    public Collection<ConfigurationErrorListener> getErrorListeners()
     {
         return super.getErrorListeners();
     }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PatternSubtreeConfigurationWrapper.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PatternSubtreeConfigurationWrapper.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PatternSubtreeConfigurationWrapper.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PatternSubtreeConfigurationWrapper.java Fri Jun 19 10:35:01 2009
@@ -14,31 +14,28 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.commons.configuration2;
 
-import org.apache.commons.configuration2.tree.ConfigurationNode;
-import org.apache.commons.configuration2.expr.ExpressionEngine;
-import org.apache.commons.configuration2.event.ConfigurationListener;
-import org.apache.commons.configuration2.event.ConfigurationErrorListener;
+package org.apache.commons.configuration2;
 
+import java.io.Reader;
+import java.io.Writer;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
-import java.util.Collection;
-import java.io.Writer;
-import java.io.Reader;
-
 
+import org.apache.commons.configuration2.event.ConfigurationErrorListener;
+import org.apache.commons.configuration2.event.ConfigurationListener;
+import org.apache.commons.configuration2.expr.ExpressionEngine;
+import org.apache.commons.configuration2.tree.ConfigurationNode;
 
 /**
  * Wraps a HierarchicalConfiguration and allows subtrees to be access via a configured path with
  * replaceable tokens derived from the MDC.
  * @since 1.6
- * @author <a
- * href="http://commons.apache.org/configuration/team-list.html">Commons
- * Configuration team</a>
+ * @author <a href="http://commons.apache.org/configuration/team-list.html">Commons Configuration team</a>
  * @version $Id:  $
  */
 public class PatternSubtreeConfigurationWrapper extends AbstractHierarchicalFileConfiguration
@@ -376,7 +373,7 @@
     }
 
     @Override
-    public Collection getConfigurationListeners()
+    public Collection<ConfigurationListener> getConfigurationListeners()
     {
         return getConfig().getConfigurationListeners();
     }
@@ -416,7 +413,7 @@
     }
 
     @Override
-    public Collection getErrorListeners()
+    public Collection<ConfigurationErrorListener> getErrorListeners()
     {
         return getConfig().getErrorListeners();
     }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertiesConfigurationLayout.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertiesConfigurationLayout.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertiesConfigurationLayout.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/PropertiesConfigurationLayout.java Fri Jun 19 10:35:01 2009
@@ -490,8 +490,7 @@
                     int blancLines = 0;
                     int idx = checkHeaderComment(reader.getCommentLines());
                     while (idx < reader.getCommentLines().size()
-                            && ((String) reader.getCommentLines().get(idx))
-                                    .length() < 1)
+                            && (reader.getCommentLines().get(idx)).length() < 1)
                     {
                         idx++;
                         blancLines++;
@@ -639,7 +638,7 @@
             throw new IllegalArgumentException("Property key must not be null!");
         }
 
-        PropertyLayoutData data = (PropertyLayoutData) layoutData.get(key);
+        PropertyLayoutData data = layoutData.get(key);
         if (data == null)
         {
             data = new PropertyLayoutData();
@@ -819,8 +818,7 @@
     {
         for (String key : c.getKeys())
         {
-            PropertyLayoutData data = (PropertyLayoutData) c.layoutData
-                    .get(key);
+            PropertyLayoutData data = c.layoutData.get(key);
             layoutData.put(key, (PropertyLayoutData) data.clone());
         }
     }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/SubnodeConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/SubnodeConfiguration.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/SubnodeConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/SubnodeConfiguration.java Fri Jun 19 10:35:01 2009
@@ -14,11 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.configuration2;
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.commons.configuration2.interpol.ConfigurationInterpolator;
@@ -264,8 +264,7 @@
      * @return a hierarchical configuration for this sub node
      * @since 1.5
      */
-    protected SubnodeConfiguration createSubnodeConfiguration(
-            ConfigurationNode node, String subnodeKey)
+    protected SubnodeConfiguration createSubnodeConfiguration(ConfigurationNode node, String subnodeKey)
     {
         SubnodeConfiguration result = createSubnodeConfiguration(node);
 
@@ -274,9 +273,9 @@
             // construct the correct subnode key
             // determine path to root node
             List<ConfigurationNode> lstPathToRoot = new ArrayList<ConfigurationNode>();
-            ConfigurationNode top = super.getRootNode();
+            ConfigurationNode root = super.getRootNode();
             ConfigurationNode nd = node;
-            while (nd != top)
+            while (nd != root)
             {
                 lstPathToRoot.add(nd);
                 nd = nd.getParentNode();
@@ -285,10 +284,9 @@
             // construct the keys for the nodes on this path
             Collections.reverse(lstPathToRoot);
             String key = getSubnodeKey();
-            for (Iterator it = lstPathToRoot.iterator(); it.hasNext();)
+            for (ConfigurationNode pathElement : lstPathToRoot)
             {
-                key = getParent().getExpressionEngine().nodeKey(
-                        (ConfigurationNode) it.next(), key);
+                key = getParent().getExpressionEngine().nodeKey(pathElement, key);
             }
             result.setSubnodeKey(key);
         }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/AbstractHierarchicalConfigurationSource.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/AbstractHierarchicalConfigurationSource.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/AbstractHierarchicalConfigurationSource.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/AbstractHierarchicalConfigurationSource.java Fri Jun 19 10:35:01 2009
@@ -120,8 +120,8 @@
      * the associated {@code ExpressionEngine}, so the passed in key must match
      * the requirements of this implementation.
      *
-     * @param key the key of the new property
-     * @param obj the value of the new property
+     * @param key   the key of the new property
+     * @param value the value of the new property
      */
     public void addProperty(String key, Object value)
     {
@@ -560,13 +560,11 @@
         // Create missing nodes on the path
         for (String nodeName : data.getPathNodes())
         {
-            T child = createNode(node, nodeName);
-            node = child;
+            node = createNode(node, nodeName);
         }
 
         // Add the new property
-        return addNodeValue(node, data.getNewNodeName(), value, data
-                .isAttribute());
+        return addNodeValue(node, data.getNewNodeName(), value, data.isAttribute());
     }
 
     /**
@@ -592,8 +590,7 @@
         }
         else
         {
-            T child = createNode(parent, name, value);
-            return child;
+            return createNode(parent, name, value);
         }
     }
 
@@ -820,10 +817,8 @@
         @Override
         public void visitBeforeChildren(T node, NodeHandler<T> handler)
         {
-            String parentKey = parentKeys.isEmpty() ? null
-                    : (String) parentKeys.peek();
-            String key = getExpressionEngine()
-                    .nodeKey(node, parentKey, handler);
+            String parentKey = parentKeys.isEmpty() ? null : parentKeys.peek();
+            String key = getExpressionEngine().nodeKey(node, parentKey, handler);
             parentKeys.push(key);
             if (handler.getValue(node) != null)
             {

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/BeanHelper.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/BeanHelper.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/BeanHelper.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/BeanHelper.java Fri Jun 19 10:35:01 2009
@@ -451,7 +451,7 @@
         String factoryName = data.getBeanFactoryName();
         if (factoryName != null)
         {
-            BeanFactory factory = (BeanFactory) beanFactories.get(factoryName);
+            BeanFactory factory = beanFactories.get(factoryName);
             if (factory == null)
             {
                 throw new ConfigurationRuntimeException("Unknown bean factory: " + factoryName);

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/XMLBeanDeclaration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/XMLBeanDeclaration.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/XMLBeanDeclaration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/XMLBeanDeclaration.java Fri Jun 19 10:35:01 2009
@@ -196,7 +196,7 @@
      */
     public XMLBeanDeclaration(AbstractHierarchicalConfiguration<T> config)
     {
-        this(config, (String) null);
+        this(config, null);
     }
 
     /**

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/combined/DynamicCombinedConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/combined/DynamicCombinedConfiguration.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/combined/DynamicCombinedConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/combined/DynamicCombinedConfiguration.java Fri Jun 19 10:35:01 2009
@@ -634,7 +634,7 @@
     }
 
     @Override
-    public Collection getConfigurationListeners()
+    public Collection<ConfigurationListener> getConfigurationListeners()
     {
         return super.getConfigurationListeners();
     }
@@ -680,7 +680,7 @@
     }
 
     @Override
-    public Collection getErrorListeners()
+    public Collection<ConfigurationErrorListener> getErrorListeners()
     {
         return super.getErrorListeners();
     }
@@ -741,21 +741,18 @@
             {
                 config = new CombinedConfiguration(getNodeCombiner());
                 config.setExpressionEngine(this.getExpressionEngine());
-                for (ConfigurationErrorListener listener
-                        : (Collection<ConfigurationErrorListener>) config.getErrorListeners())
+                for (ConfigurationErrorListener listener : config.getErrorListeners())
                 {
                     config.addErrorListener(listener);
                 }
-                for (ConfigurationListener listener
-                        : (Collection<ConfigurationListener>) config.getConfigurationListeners())
+                for (ConfigurationListener listener : config.getConfigurationListeners())
                 {
                     config.addConfigurationListener(listener);
                 }
                 config.setForceReloadCheck(isForceReloadCheck());
                 for (ConfigData data : configurations)
                 {
-                    config.addConfiguration(data.getConfiguration(), data.getName(),
-                            data.getAt());
+                    config.addConfiguration(data.getConfiguration(), data.getName(), data.getAt());
                 }
                 configs.put(key, config);
             }
@@ -793,7 +790,7 @@
             this.at = at;
         }
 
-                /**
+        /**
          * Returns the stored configuration.
          *
          * @return the configuration

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/event/EventSource.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/event/EventSource.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/event/EventSource.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/event/EventSource.java Fri Jun 19 10:35:01 2009
@@ -14,12 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.configuration2.event;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.LinkedList;
 
 /**
@@ -229,7 +229,7 @@
      */
     protected void fireEvent(int type, String propName, Object propValue, boolean before)
     {
-        Collection listenersToCall = null;
+        Collection<ConfigurationListener> listenersToCall = null;
 
         synchronized (listeners)
         {
@@ -237,16 +237,16 @@
             {
                 // Copy listeners to another collection so that manipulating
                 // the listener list during event delivery won't cause problems
-                listenersToCall = new ArrayList(listeners);
+                listenersToCall = new ArrayList<ConfigurationListener>(listeners);
             }
         }
 
         if (listenersToCall != null)
         {
             ConfigurationEvent event = createEvent(type, propName, propValue, before);
-            for (Iterator it = listenersToCall.iterator(); it.hasNext();)
+            for (ConfigurationListener listener : listenersToCall)
             {
-                ((ConfigurationListener) it.next()).configurationChanged(event);
+                listener.configurationChanged(event);
             }
         }
     }
@@ -294,9 +294,9 @@
         if (listenersToCall != null)
         {
             ConfigurationErrorEvent event = createErrorEvent(type, propName, propValue, ex);
-            for (Iterator it = listenersToCall.iterator(); it.hasNext();)
+            for (ConfigurationErrorListener listener : listenersToCall)
             {
-                ((ConfigurationErrorListener) it.next()).configurationError(event);
+                listener.configurationError(event);
             }
         }
     }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/expr/xpath/ConfigurationNodePointerFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/expr/xpath/ConfigurationNodePointerFactory.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/expr/xpath/ConfigurationNodePointerFactory.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/expr/xpath/ConfigurationNodePointerFactory.java Fri Jun 19 10:35:01 2009
@@ -86,15 +86,12 @@
      * @return a pointer for a configuration node if the bean is such a node
      */
     @SuppressWarnings("unchecked")
-    public NodePointer createNodePointer(NodePointer parent, QName name,
-            Object bean)
+    public NodePointer createNodePointer(NodePointer parent, QName name, Object bean)
     {
         if (bean instanceof NodeWrapper)
         {
             NodeWrapper<?> wrapper = (NodeWrapper<?>) bean;
-            return new ConfigurationNodePointer(
-                    (ConfigurationNodePointer) parent, wrapper.getNode(),
-                    wrapper.getNodeHandler());
+            return new ConfigurationNodePointer(parent, wrapper.getNode(), wrapper.getNodeHandler());
         }
         return null;
     }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/CatalogResolver.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/CatalogResolver.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/CatalogResolver.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/CatalogResolver.java Fri Jun 19 10:35:01 2009
@@ -14,73 +14,56 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.commons.configuration2.resolver;
 
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.impl.NoOpLog;
-import org.apache.commons.configuration2.FileSystem;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.FileNameMap;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Vector;
+
 import org.apache.commons.configuration2.ConfigurationException;
 import org.apache.commons.configuration2.ConfigurationUtils;
+import org.apache.commons.configuration2.FileSystem;
 import org.apache.commons.lang.text.StrSubstitutor;
-import org.apache.xml.resolver.readers.CatalogReader;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.impl.NoOpLog;
 import org.apache.xml.resolver.CatalogException;
-
-import java.net.FileNameMap;
-import java.net.URLConnection;
-import java.net.URL;
-import java.io.InputStream;
-import java.io.IOException;
-import java.util.Vector;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Retention;
+import org.apache.xml.resolver.readers.CatalogReader;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
 
 /**
  * Thin wrapper around xml commons CatalogResolver to allow list of catalogs
  * to be provided.
- * @author <a
- * href="http://commons.apache.org/configuration/team-list.html">Commons
- * Configuration team</a>
+ * @author <a href="http://commons.apache.org/configuration/team-list.html">Commons Configuration team</a>
  * @since 1.7
- * @version $Id:  $
+ * @version $Revision$, $Date$
  */
 public class CatalogResolver implements EntityResolver
 {
-    /**
-     * Debug everything.
-     */
+    /** Debug everything. */
     private static final int DEBUG_ALL = 9;
 
-    /**
-     * Normal debug setting.
-     */
+    /** Normal debug setting. */
     private static final int DEBUG_NORMAL = 4;
 
-    /**
-     * Debug nothing.
-     */
+    /** Debug nothing. */
     private static final int DEBUG_NONE = 0;
 
-    /**
-     * The CatalogManager
-     */
+    /** The CatalogManager */
     protected CatalogManager manager = new CatalogManager();
 
-    /**
-     * The FileSystem in use.
-     */
+    /** The FileSystem in use. */
     protected FileSystem fs = FileSystem.getDefaultFileSystem();
 
-    /**
-     * The CatalogResolver
-     */
+    /** The CatalogResolver */
     private org.apache.xml.resolver.tools.CatalogResolver resolver;
 
-    /**
-     * Stores the logger.
-     */
+    /** Stores the logger. */
     private Log log;
 
     /**

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/DefaultEntityResolver.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/DefaultEntityResolver.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/DefaultEntityResolver.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/DefaultEntityResolver.java Fri Jun 19 10:35:01 2009
@@ -38,7 +38,7 @@
 public class DefaultEntityResolver implements EntityResolver, EntityRegistry
 {
     /** Stores a map with the registered public IDs.*/
-    private Map registeredEntities = new HashMap();
+    private Map<String, URL> registeredEntities = new HashMap<String, URL>();
 
     /**
      * <p>
@@ -123,7 +123,7 @@
      *
      * @return a map with the registered entity IDs
      */
-    public Map getRegisteredEntities()
+    public Map<String, URL> getRegisteredEntities()
     {
         return registeredEntities;
     }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java Fri Jun 19 10:35:01 2009
@@ -119,7 +119,7 @@
             ConfigurationNode node2, ConfigurationNode child, List children2)
     {
         List<ConfigurationNode> attrs1 = child.getAttributes();
-        List<ConfigurationNode> nodes = new ArrayList();
+        List<ConfigurationNode> nodes = new ArrayList<ConfigurationNode>();
 
         List<ConfigurationNode> children = node2.getChildren(child.getName());
         for (ConfigurationNode node : children)

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/NodeCombiner.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/NodeCombiner.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/NodeCombiner.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/NodeCombiner.java Fri Jun 19 10:35:01 2009
@@ -20,8 +20,6 @@
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
-import java.util.List;
-import java.io.PrintStream;
 
 /**
  * <p>

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/OverrideCombiner.java Fri Jun 19 10:35:01 2009
@@ -17,8 +17,6 @@
 
 package org.apache.commons.configuration2.tree;
 
-import java.util.Iterator;
-
 /**
  * <p>
  * A concrete combiner implementation that is able to construct an override
@@ -49,9 +47,7 @@
  * will never be combined.
  * </p>
  *
- * @author <a
- * href="http://commons.apache.org/configuration/team-list.html">Commons
- * Configuration team</a>
+ * @author <a href="http://commons.apache.org/configuration/team-list.html">Commons Configuration team</a>
  * @version $Id$
  * @since 1.3
  */
@@ -70,9 +66,8 @@
         result.setName(node1.getName());
 
         // Process nodes from the first structure, which override the second
-        for (Iterator<ConfigurationNode> it = node1.getChildren().iterator(); it.hasNext();)
+        for (ConfigurationNode child : node1.getChildren())
         {
-            ConfigurationNode child = it.next();
             ConfigurationNode child2 = canCombine(node1, node2, child);
             if (child2 != null)
             {

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/ViewNode.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/ViewNode.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/ViewNode.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/ViewNode.java Fri Jun 19 10:35:01 2009
@@ -45,11 +45,9 @@
      */
     public void addAttribute(ConfigurationNode attr)
     {
-        ConfigurationNode parent = null;
-
         if (attr != null)
         {
-            parent = attr.getParentNode();
+            ConfigurationNode parent = attr.getParentNode();
             super.addAttribute(attr);
             attr.setParentNode(parent);
         }
@@ -67,11 +65,9 @@
      */
     public void addChild(ConfigurationNode child)
     {
-        ConfigurationNode parent = null;
-
         if (child != null)
         {
-            parent = child.getParentNode();
+            ConfigurationNode parent = child.getParentNode();
             super.addChild(child);
             child.setParentNode(parent);
         }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/web/AppletConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/web/AppletConfiguration.java?rev=786440&r1=786439&r2=786440&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/web/AppletConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/web/AppletConfiguration.java Fri Jun 19 10:35:01 2009
@@ -58,9 +58,9 @@
         List<String> keyList = new ArrayList<String>(paramsInfo != null ? paramsInfo.length : 0);
         if (paramsInfo != null)
         {
-            for (int i = 0; i < paramsInfo.length; i++)
+            for (String[] paramInfo : paramsInfo)
             {
-                keyList.add(paramsInfo[i][0]);
+                keyList.add(paramInfo[0]);
             }
         }
 



Mime
View raw message