commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1301991 - in /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration: ./ beanutils/ resolver/ tree/
Date Sat, 17 Mar 2012 20:18:03 GMT
Author: sebb
Date: Sat Mar 17 20:18:02 2012
New Revision: 1301991

URL: http://svn.apache.org/viewvc?rev=1301991&view=rev
Log:
Unnecessary casts

Modified:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/HierarchicalConfiguration.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/PropertiesConfigurationLayout.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/beanutils/BeanHelper.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/CatalogResolver.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/DefaultEntityResolver.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/DefaultConfigurationNode.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/DefaultExpressionEngine.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/MergeCombiner.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/OverrideCombiner.java
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/TreeUtils.java

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/HierarchicalConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/HierarchicalConfiguration.java?rev=1301991&r1=1301990&r2=1301991&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/HierarchicalConfiguration.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/HierarchicalConfiguration.java
Sat Mar 17 20:18:02 2012
@@ -750,7 +750,7 @@ public class HierarchicalConfiguration e
 
         while (itNodes.hasNext() && itValues.hasNext())
         {
-            ((ConfigurationNode) itNodes.next()).setValue(itValues.next());
+            itNodes.next().setValue(itValues.next());
         }
 
         // Add additional nodes if necessary
@@ -762,7 +762,7 @@ public class HierarchicalConfiguration e
         // Remove remaining nodes
         while (itNodes.hasNext())
         {
-            clearNode((ConfigurationNode) itNodes.next());
+            clearNode(itNodes.next());
         }
 
         fireEvent(EVENT_SET_PROPERTY, key, value, false);

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/PropertiesConfigurationLayout.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/PropertiesConfigurationLayout.java?rev=1301991&r1=1301990&r2=1301991&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/PropertiesConfigurationLayout.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/PropertiesConfigurationLayout.java
Sat Mar 17 20:18:02 2012
@@ -490,8 +490,7 @@ public class PropertiesConfigurationLayo
                     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++;
@@ -797,7 +796,7 @@ public class PropertiesConfigurationLayo
             // This is the first comment. Search for blanc lines.
             int index = commentLines.size() - 1;
             while (index >= 0
-                    && ((String) commentLines.get(index)).length() > 0)
+                    && commentLines.get(index).length() > 0)
             {
                 index--;
             }
@@ -819,8 +818,7 @@ public class PropertiesConfigurationLayo
     {
         for (String key : c.getKeys())
         {
-            PropertyLayoutData data = (PropertyLayoutData) c.layoutData
-                    .get(key);
+            PropertyLayoutData data = c.layoutData.get(key);
             layoutData.put(key, data.clone());
         }
     }

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/beanutils/BeanHelper.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/beanutils/BeanHelper.java?rev=1301991&r1=1301990&r2=1301991&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/beanutils/BeanHelper.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/beanutils/BeanHelper.java
Sat Mar 17 20:18:02 2012
@@ -448,7 +448,7 @@ public final class BeanHelper
         String factoryName = data.getBeanFactoryName();
         if (factoryName != null)
         {
-            BeanFactory factory = (BeanFactory) beanFactories.get(factoryName);
+            BeanFactory factory = beanFactories.get(factoryName);
             if (factory == null)
             {
                 throw new ConfigurationRuntimeException(

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/CatalogResolver.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/CatalogResolver.java?rev=1301991&r1=1301990&r2=1301991&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/CatalogResolver.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/CatalogResolver.java
Sat Mar 17 20:18:02 2012
@@ -385,7 +385,7 @@ public class CatalogResolver implements 
             {
                 for (int count = 0; count < catalogs.size(); count++)
                 {
-                    String fileName = (String) catalogs.elementAt(count);
+                    String fileName = catalogs.elementAt(count);
 
                     URL url = null;
                     InputStream is = null;

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/DefaultEntityResolver.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/DefaultEntityResolver.java?rev=1301991&r1=1301990&r2=1301991&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/DefaultEntityResolver.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/resolver/DefaultEntityResolver.java
Sat Mar 17 20:18:02 2012
@@ -89,7 +89,7 @@ public class DefaultEntityResolver imple
         URL entityURL = null;
         if (publicId != null)
         {
-            entityURL = (URL) getRegisteredEntities().get(publicId);
+            entityURL = getRegisteredEntities().get(publicId);
         }
 
         if (entityURL != null)

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/DefaultConfigurationNode.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/DefaultConfigurationNode.java?rev=1301991&r1=1301990&r2=1301991&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/DefaultConfigurationNode.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/DefaultConfigurationNode.java
Sat Mar 17 20:18:02 2012
@@ -611,7 +611,7 @@ public class DefaultConfigurationNode im
             {
                 throw new IndexOutOfBoundsException("No sub nodes available!");
             }
-            return (ConfigurationNode) nodes.get(index);
+            return nodes.get(index);
         }
 
         /**

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/DefaultExpressionEngine.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/DefaultExpressionEngine.java?rev=1301991&r1=1301990&r2=1301991&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/DefaultExpressionEngine.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/DefaultExpressionEngine.java
Sat Mar 17 20:18:02 2012
@@ -503,8 +503,7 @@ public class DefaultExpressionEngine imp
             }
             else
             {
-                return findLastPathNode(keyIt, (ConfigurationNode) node
-                        .getChildren(keyPart).get(idx));
+                return findLastPathNode(keyIt, node.getChildren(keyPart).get(idx));
             }
         }
 
@@ -531,8 +530,7 @@ public class DefaultExpressionEngine imp
             if (keyPart.getIndex() >= 0 && keyPart.getIndex() < subNodes.size())
             {
                 findNodesForKey((DefaultConfigurationKey.KeyIterator) keyPart
-                        .clone(), (ConfigurationNode) subNodes.get(keyPart
-                        .getIndex()), nodes);
+                        .clone(), subNodes.get(keyPart.getIndex()), nodes);
             }
         }
         else

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/MergeCombiner.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/MergeCombiner.java?rev=1301991&r1=1301990&r2=1301991&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/MergeCombiner.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/MergeCombiner.java
Sat Mar 17 20:18:02 2012
@@ -148,7 +148,7 @@ public class MergeCombiner extends NodeC
 
         if (nodes.size() == 1)
         {
-            return (ConfigurationNode) nodes.get(0);
+            return nodes.get(0);
         }
         if (nodes.size() > 1 && !isListNode(child))
         {

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/OverrideCombiner.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/OverrideCombiner.java?rev=1301991&r1=1301990&r2=1301991&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/OverrideCombiner.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/OverrideCombiner.java
Sat Mar 17 20:18:02 2012
@@ -143,8 +143,7 @@ public class OverrideCombiner extends No
                 && node1.getChildrenCount(child.getName()) == 1
                 && !isListNode(child))
         {
-            return (ConfigurationNode) node2.getChildren(child.getName())
-                    .get(0);
+            return node2.getChildren(child.getName()).get(0);
         }
         else
         {

Modified: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/TreeUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/TreeUtils.java?rev=1301991&r1=1301990&r2=1301991&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/TreeUtils.java
(original)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/tree/TreeUtils.java
Sat Mar 17 20:18:02 2012
@@ -53,7 +53,7 @@ public final class TreeUtils
         Iterator<ConfigurationNode> iter = result.getAttributes().iterator();
         while (iter.hasNext())
         {
-            ConfigurationNode node = (ConfigurationNode) iter.next();
+            ConfigurationNode node = iter.next();
             buffer.append(" ").append(node.getName()).append("='").append(node.getValue()).append("'");
         }
         buffer.append(">");
@@ -69,7 +69,7 @@ public final class TreeUtils
             iter = result.getChildren().iterator();
             while (iter.hasNext())
             {
-                printTree(stream, indent + "  ", (ConfigurationNode) iter.next());
+                printTree(stream, indent + "  ", iter.next());
             }
             newline = true;
         }



Mime
View raw message