commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r951365 - in /commons/proper/dbutils/trunk/src: java/org/apache/commons/dbutils/ java/org/apache/commons/dbutils/wrappers/ test/org/apache/commons/dbutils/ test/org/apache/commons/dbutils/handlers/
Date Fri, 04 Jun 2010 11:07:37 GMT
Author: sebb
Date: Fri Jun  4 11:07:37 2010
New Revision: 951365

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

Modified:
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryLoader.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
    commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java
    commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/ResultSetIteratorTest.java
    commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/ArrayHandlerTest.java
    commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/ArrayListHandlerTest.java
    commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/BeanHandlerTest.java
    commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/BeanListHandlerTest.java

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryLoader.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryLoader.java?rev=951365&r1=951364&r2=951365&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryLoader.java (original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryLoader.java Fri
Jun  4 11:07:37 2010
@@ -71,7 +71,7 @@ public class QueryLoader {
      */
     public synchronized Map<String,String> load(String path) throws IOException {
 
-        Map<String,String> queryMap = (Map<String,String>) this.queries.get(path);
+        Map<String,String> queryMap = this.queries.get(path);
 
         if (queryMap == null) {
             queryMap = this.loadQueries(path);

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java?rev=951365&r1=951364&r2=951365&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
Fri Jun  4 11:07:37 2010
@@ -377,7 +377,7 @@ public class SqlNullCheckedResultSet imp
 
         Object result = method.invoke(this.rs, args);
 
-        Method nullMethod = (Method) nullMethods.get(method.getName());
+        Method nullMethod = nullMethods.get(method.getName());
 
         // Check nullMethod != null first so that we don't call wasNull()
         // before a true getter method was invoked on the ResultSet.

Modified: commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java?rev=951365&r1=951364&r2=951365&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java (original)
+++ commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java Fri
Jun  4 11:07:37 2010
@@ -331,7 +331,7 @@ public class MockResultSet implements In
         if (!this.iter.hasNext()) {
             return Boolean.FALSE;
         } else {
-            this.currentRow = (Object[]) iter.next();
+            this.currentRow = iter.next();
             return Boolean.TRUE;
         }
     }

Modified: commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/ResultSetIteratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/ResultSetIteratorTest.java?rev=951365&r1=951364&r2=951365&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/ResultSetIteratorTest.java
(original)
+++ commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/ResultSetIteratorTest.java
Fri Jun  4 11:07:37 2010
@@ -29,14 +29,14 @@ public class ResultSetIteratorTest exten
 
 		Object[] row = null;
 		assertTrue(iter.hasNext());
-		row = (Object[]) iter.next();
+		row = iter.next();
 		assertEquals(COLS, row.length);
 		assertEquals("1", row[0]);
 		assertEquals("2", row[1]);
 		assertEquals("3", row[2]);
 		
 		assertTrue(iter.hasNext());
-		row = (Object[]) iter.next();
+		row = iter.next();
 		assertEquals(COLS, row.length);
 
 		assertEquals("4", row[0]);

Modified: commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/ArrayHandlerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/ArrayHandlerTest.java?rev=951365&r1=951364&r2=951365&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/ArrayHandlerTest.java
(original)
+++ commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/ArrayHandlerTest.java
Fri Jun  4 11:07:37 2010
@@ -28,7 +28,7 @@ public class ArrayHandlerTest extends Ba
 
 	public void testHandle() throws SQLException {
 		ResultSetHandler<Object[]> h = new ArrayHandler();
-		Object[] results = (Object[]) h.handle(this.rs);
+		Object[] results = h.handle(this.rs);
         
 		assertNotNull(results);
 		assertEquals(COLS, results.length);
@@ -39,7 +39,7 @@ public class ArrayHandlerTest extends Ba
     
     public void testEmptyResultSetHandle() throws SQLException {
         ResultSetHandler<Object[]> h = new ArrayHandler();
-        Object[] results = (Object[]) h.handle(this.emptyResultSet);
+        Object[] results = h.handle(this.emptyResultSet);
         
         assertNull(results);
     }

Modified: commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/ArrayListHandlerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/ArrayListHandlerTest.java?rev=951365&r1=951364&r2=951365&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/ArrayListHandlerTest.java
(original)
+++ commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/ArrayListHandlerTest.java
Fri Jun  4 11:07:37 2010
@@ -38,14 +38,14 @@ public class ArrayListHandlerTest extend
 		Iterator<Object[]> iter = results.iterator();
 	    Object[] row = null;
 	    assertTrue(iter.hasNext());
-	    row = (Object[]) iter.next();
+	    row = iter.next();
 	    assertEquals(COLS, row.length);
 	    assertEquals("1", row[0]);
 	    assertEquals("2", row[1]);
 	    assertEquals("3", row[2]);
 	        
 	    assertTrue(iter.hasNext());
-	    row = (Object[]) iter.next();
+	    row = iter.next();
 	    assertEquals(COLS, row.length);
 
 	    assertEquals("4", row[0]);

Modified: commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/BeanHandlerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/BeanHandlerTest.java?rev=951365&r1=951364&r2=951365&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/BeanHandlerTest.java
(original)
+++ commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/BeanHandlerTest.java
Fri Jun  4 11:07:37 2010
@@ -40,7 +40,7 @@ public class BeanHandlerTest extends Bas
     
     public void testEmptyResultSetHandle() throws SQLException {
         ResultSetHandler<TestBean> h = new BeanHandler<TestBean>(TestBean.class);
-        TestBean results = (TestBean) h.handle(this.emptyResultSet);
+        TestBean results = h.handle(this.emptyResultSet);
         
         assertNull(results);
     }

Modified: commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/BeanListHandlerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/BeanListHandlerTest.java?rev=951365&r1=951364&r2=951365&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/BeanListHandlerTest.java
(original)
+++ commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/BeanListHandlerTest.java
Fri Jun  4 11:07:37 2010
@@ -31,7 +31,7 @@ public class BeanListHandlerTest extends
 
 	public void testHandle() throws SQLException {
 		ResultSetHandler<List<TestBean>> h = new BeanListHandler<TestBean>(TestBean.class);
-		List<TestBean> results = (List<TestBean>) h.handle(this.rs);
+		List<TestBean> results = h.handle(this.rs);
 
 		assertNotNull(results);
 		assertEquals(ROWS, results.size());
@@ -39,14 +39,14 @@ public class BeanListHandlerTest extends
 		Iterator<TestBean> iter = results.iterator();
 		TestBean row = null;
         assertTrue(iter.hasNext());
-        row = (TestBean) iter.next();
+        row = iter.next();
         assertEquals("1", row.getOne());
         assertEquals("2", row.getTwo());
         assertEquals("3", row.getThree());
         assertEquals("not set", row.getDoNotSet());
             
         assertTrue(iter.hasNext());
-        row = (TestBean) iter.next();
+        row = iter.next();
 
         assertEquals("4", row.getOne());
         assertEquals("5", row.getTwo());



Mime
View raw message