commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r903759 - in /commons/proper/digester/trunk/src: java/org/apache/commons/digester/ java/org/apache/commons/digester/plugins/ java/org/apache/commons/digester/xmlrules/ test/org/apache/commons/digester/ test/org/apache/commons/digester/subst...
Date Wed, 27 Jan 2010 17:48:29 GMT
Author: sebb
Date: Wed Jan 27 17:48:28 2010
New Revision: 903759

URL: http://svn.apache.org/viewvc?rev=903759&view=rev
Log:
Remove unnecessary casts

Modified:
    commons/proper/digester/trunk/src/java/org/apache/commons/digester/SetNestedPropertiesRule.java
    commons/proper/digester/trunk/src/java/org/apache/commons/digester/plugins/PluginCreateRule.java
    commons/proper/digester/trunk/src/java/org/apache/commons/digester/plugins/PluginManager.java
    commons/proper/digester/trunk/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/CallMethodRuleTestCase.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/DigesterTestCase.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/NodeCreateRuleTestCase.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/TestFactoryCreate.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/substitution/VariableExpansionTestCase.java
    commons/proper/digester/trunk/src/test/org/apache/commons/digester/xmlrules/TestObject.java

Modified: commons/proper/digester/trunk/src/java/org/apache/commons/digester/SetNestedPropertiesRule.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/java/org/apache/commons/digester/SetNestedPropertiesRule.java?rev=903759&r1=903758&r2=903759&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/java/org/apache/commons/digester/SetNestedPropertiesRule.java
(original)
+++ commons/proper/digester/trunk/src/java/org/apache/commons/digester/SetNestedPropertiesRule.java
Wed Jan 27 17:48:28 2010
@@ -401,7 +401,7 @@
             String propName = currChildElementName;
             if (elementNames.containsKey(currChildElementName)) {
                 // overide propName
-                propName = (String) elementNames.get(currChildElementName);
+                propName = elementNames.get(currChildElementName);
                 if (propName == null) {
                     // user wants us to ignore this element
                     return;

Modified: commons/proper/digester/trunk/src/java/org/apache/commons/digester/plugins/PluginCreateRule.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/java/org/apache/commons/digester/plugins/PluginCreateRule.java?rev=903759&r1=903758&r2=903759&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/java/org/apache/commons/digester/plugins/PluginCreateRule.java
(original)
+++ commons/proper/digester/trunk/src/java/org/apache/commons/digester/plugins/PluginCreateRule.java
Wed Jan 27 17:48:28 2010
@@ -509,7 +509,7 @@
             boolean debug = log.isDebugEnabled();
             for (int i = 0; i < rules.size(); i++) {
                 try {
-                    Rule rule = (Rule) rules.get(i);
+                    Rule rule = rules.get(i);
                     if (debug) {
                         log.debug("  Fire begin() for " + rule);
                     }
@@ -538,7 +538,7 @@
             boolean debug = log.isDebugEnabled();
             for (int i = 0; i < rules.size(); i++) {
                 try {
-                    Rule rule = (Rule) rules.get(i);
+                    Rule rule = rules.get(i);
                     if (debug) {
                         log.debug("  Fire body() for " + rule);
                     }
@@ -569,7 +569,7 @@
             for (int i = 0; i < rules.size(); i++) {
                 int j = (rules.size() - i) - 1;
                 try {
-                    Rule rule = (Rule) rules.get(j);
+                    Rule rule = rules.get(j);
                     if (debug) {
                         log.debug("  Fire end() for " + rule);
                     }

Modified: commons/proper/digester/trunk/src/java/org/apache/commons/digester/plugins/PluginManager.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/java/org/apache/commons/digester/plugins/PluginManager.java?rev=903759&r1=903758&r2=903759&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/java/org/apache/commons/digester/plugins/PluginManager.java
(original)
+++ commons/proper/digester/trunk/src/java/org/apache/commons/digester/plugins/PluginManager.java
Wed Jan 27 17:48:28 2010
@@ -111,7 +111,7 @@
      */
     public Declaration getDeclarationByClass(String className) {
         Declaration decl = 
-            (Declaration) declarationsByClass.get(className);
+            declarationsByClass.get(className);
             
         if ((decl == null) && (parent != null)) {
             decl = parent.getDeclarationByClass(className);
@@ -128,7 +128,7 @@
      *@return The declaration value
      */
     public Declaration getDeclarationById(String id) {
-        Declaration decl = (Declaration) declarationsById.get(id);
+        Declaration decl = declarationsById.get(id);
 
         if ((decl == null) && (parent != null)) {
             decl = parent.getDeclarationById(id);
@@ -162,7 +162,7 @@
             for(Iterator<RuleFinder> i = ruleFinders.iterator(); 
                 i.hasNext() && ruleLoader == null; ) {
                     
-                RuleFinder finder = (RuleFinder) i.next();
+                RuleFinder finder = i.next();
                 if (debug) {
                     log.debug("checking finder of type " + finder.getClass().getName());
                 }

Modified: commons/proper/digester/trunk/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.java?rev=903759&r1=903758&r2=903759&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.java
(original)
+++ commons/proper/digester/trunk/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.java
Wed Jan 27 17:48:28 2010
@@ -596,7 +596,7 @@
                 while (tokens.hasMoreTokens()) {
                     paramTypesList.add(tokens.nextToken());
                 }
-                paramTypesArray = (String[])paramTypesList.toArray(new String[0]);
+                paramTypesArray = paramTypesList.toArray(new String[0]);
             } else {
                 paramTypesArray = new String[0];
             }

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/CallMethodRuleTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/CallMethodRuleTestCase.java?rev=903759&r1=903758&r2=903759&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/CallMethodRuleTestCase.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/CallMethodRuleTestCase.java
Wed Jan 27 17:48:28 2010
@@ -644,10 +644,10 @@
         assertNotNull(map);
         Set<String> keys = map.keySet();
         assertEquals(2, keys.size());
-        Address home = (Address) map.get("home");
+        Address home = map.get("home");
         assertNotNull(home);
         assertEquals("HmZip", home.getZipCode());
-        Address office = (Address) map.get("office");
+        Address office = map.get("office");
         assertNotNull(office);
         assertEquals("OfZip", office.getZipCode());
     }
@@ -673,10 +673,10 @@
         assertNotNull(map);
         Set<String> keys = map.keySet();
         assertEquals(2, keys.size());
-        Address home = (Address) map.get("home");
+        Address home = map.get("home");
         assertNotNull(home);
         assertEquals("HmZip", home.getZipCode());
-        Address office = (Address) map.get("office");
+        Address office = map.get("office");
         assertNotNull(office);
         assertEquals("OfZip", office.getZipCode());
     }

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/DigesterTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/DigesterTestCase.java?rev=903759&r1=903758&r2=903759&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/DigesterTestCase.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/DigesterTestCase.java
Wed Jan 27 17:48:28 2010
@@ -206,7 +206,7 @@
 
         assertNull("Initial error handler is null",
                 digester.getErrorHandler());
-        digester.setErrorHandler((ErrorHandler) digester);
+        digester.setErrorHandler(digester);
         assertTrue("Set error handler is digester",
                 digester.getErrorHandler() == digester);
         digester.setErrorHandler(null);

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/NodeCreateRuleTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/NodeCreateRuleTestCase.java?rev=903759&r1=903758&r2=903759&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/NodeCreateRuleTestCase.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/NodeCreateRuleTestCase.java
Wed Jan 27 17:48:28 2010
@@ -219,8 +219,8 @@
         assertTrue(result instanceof Element);
         Element element = (Element)result;
         assertEquals("alpha", element.getNodeName());
-        assertNull(((Element)element).getLocalName());
-        assertNull(((Element)element).getNamespaceURI());
+        assertNull(element.getLocalName());
+        assertNull(element.getNamespaceURI());
         assertEquals(1, element.getChildNodes().getLength());
         assertEquals("ALPHA BODY", element.getFirstChild().getNodeValue());
 
@@ -482,8 +482,8 @@
         assertTrue(result instanceof Element);
         Element element = (Element)result;
         assertEquals("alpha", element.getNodeName());
-        assertNull(((Element)element).getLocalName());
-        assertNull(((Element)element).getNamespaceURI());
+        assertNull(element.getLocalName());
+        assertNull(element.getNamespaceURI());
         assertEquals(1, element.getChildNodes().getLength());
         assertEquals("A A", element.getFirstChild().getNodeValue());
     }

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/TestFactoryCreate.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/TestFactoryCreate.java?rev=903759&r1=903758&r2=903759&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/TestFactoryCreate.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/TestFactoryCreate.java
Wed Jan 27 17:48:28 2010
@@ -154,7 +154,7 @@
         digester.parse(new StringReader(xml));
         
         assertEquals("List should contain only the factory object", list.size() , 1);
-        factory = (TestObjectCreationFactory) list.get(0);
+        factory = list.get(0);
         assertEquals("Object create not called(2)[" + propagateExceptions + "]", factory.called
, true);
         assertEquals(
                     "Attribute not passed (4)[" + propagateExceptions + "]", 
@@ -184,7 +184,7 @@
         digester.parse(new StringReader(xml));
         
         assertEquals("List should contain only the factory object", list.size() , 1);
-        factory = (TestObjectCreationFactory) list.get(0);
+        factory = list.get(0);
         assertEquals("Object create not called(3)[" + propagateExceptions + "]", factory.called
, true);
         assertEquals(
                     "Attribute not passed (7)[" + propagateExceptions + "]", 
@@ -215,7 +215,7 @@
         digester.parse(new StringReader(xml));
         
         assertEquals("List should contain only the factory object", list.size() , 1);
-        factory = (TestObjectCreationFactory) list.get(0);
+        factory = list.get(0);
         assertEquals(
                     "Attribute Override Failed (1)", 
                     factory.getClass().getName() , 
@@ -248,7 +248,7 @@
         digester.parse(new StringReader(xml));
         
         assertEquals("List should contain only the factory object", list.size() , 1);
-        factory = (TestObjectCreationFactory) list.get(0);
+        factory = list.get(0);
         assertEquals("Object create not called(5)[" + propagateExceptions + "]", factory.called
, true);
         assertEquals(
                     "Attribute not passed (13)[" + propagateExceptions + "]", 
@@ -279,7 +279,7 @@
         digester.parse(new StringReader(xml));
         
         assertEquals("List should contain only the factory object", list.size() , 1);
-        factory = (TestObjectCreationFactory) list.get(0);
+        factory = list.get(0);
         assertEquals(
                     "Attribute Override Failed (2)", 
                     factory.getClass().getName() , 

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/substitution/VariableExpansionTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/substitution/VariableExpansionTestCase.java?rev=903759&r1=903758&r2=903759&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/substitution/VariableExpansionTestCase.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/substitution/VariableExpansionTestCase.java
Wed Jan 27 17:48:28 2010
@@ -219,13 +219,13 @@
         assertEquals(2, this.simpleTestBeans.size());
 
         {
-        SimpleTestBean bean = (SimpleTestBean) this.simpleTestBeans.get(0);
+        SimpleTestBean bean = this.simpleTestBeans.get(0);
         assertEquals("source1.attr1", bean.getAlpha());
         assertEquals("source2.attr1", bean.getBeta());
         }
 
         {
-        SimpleTestBean bean = (SimpleTestBean) this.simpleTestBeans.get(1);
+        SimpleTestBean bean = this.simpleTestBeans.get(1);
         assertEquals("source1.attr2", bean.getAlpha());
         assertEquals("source2.attr2", bean.getBeta());
         }
@@ -331,7 +331,7 @@
         digester.parse(input);
 
         assertEquals(1, simpleTestBeans.size());
-        SimpleTestBean bean = (SimpleTestBean) simpleTestBeans.get(0);
+        SimpleTestBean bean = simpleTestBeans.get(0);
         assertEquals("prop.value", bean.getAlpha());
     }
 
@@ -364,7 +364,7 @@
         digester.parse(input);
 
         assertEquals(1, simpleTestBeans.size());
-        SimpleTestBean bean = (SimpleTestBean) simpleTestBeans.get(0);
+        SimpleTestBean bean = simpleTestBeans.get(0);
         assertEquals("substituted-prop.value1", bean.getAlpha());
     }
 

Modified: commons/proper/digester/trunk/src/test/org/apache/commons/digester/xmlrules/TestObject.java
URL: http://svn.apache.org/viewvc/commons/proper/digester/trunk/src/test/org/apache/commons/digester/xmlrules/TestObject.java?rev=903759&r1=903758&r2=903759&view=diff
==============================================================================
--- commons/proper/digester/trunk/src/test/org/apache/commons/digester/xmlrules/TestObject.java
(original)
+++ commons/proper/digester/trunk/src/test/org/apache/commons/digester/xmlrules/TestObject.java
Wed Jan 27 17:48:28 2010
@@ -86,7 +86,7 @@
     }
 
     public String getMapValue( String name ) {
-        return (String) this.mapValue.get( name );
+        return this.mapValue.get( name );
     }
 
     public String getProperty() {



Mime
View raw message