commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r672592 - in /commons/proper/dbcp/trunk/src: java/org/apache/commons/dbcp/datasources/ test/org/apache/commons/dbcp/ test/org/apache/commons/dbcp/datasources/
Date Sat, 28 Jun 2008 23:16:51 GMT
Author: sebb
Date: Sat Jun 28 16:16:51 2008
New Revision: 672592

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

Modified:
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/SharedPoolDataSource.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterResultSet.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java?rev=672592&r1=672591&r2=672592&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/PerUserPoolDataSource.java
Sat Jun 28 16:16:51 2008
@@ -55,7 +55,7 @@
 
     private int defaultMaxActive = GenericObjectPool.DEFAULT_MAX_ACTIVE;
     private int defaultMaxIdle = GenericObjectPool.DEFAULT_MAX_IDLE;
-    private int defaultMaxWait = (int)Math.min((long)Integer.MAX_VALUE,
+    private int defaultMaxWait = (int)Math.min(Integer.MAX_VALUE,
         GenericObjectPool.DEFAULT_MAX_WAIT);
     Map perUserDefaultAutoCommit = null;    
     Map perUserDefaultTransactionIsolation = null;

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/SharedPoolDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/SharedPoolDataSource.java?rev=672592&r1=672591&r2=672592&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/SharedPoolDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/SharedPoolDataSource.java
Sat Jun 28 16:16:51 2008
@@ -49,7 +49,7 @@
 
     private int maxActive = GenericObjectPool.DEFAULT_MAX_ACTIVE;
     private int maxIdle = GenericObjectPool.DEFAULT_MAX_IDLE;
-    private int maxWait = (int)Math.min((long)Integer.MAX_VALUE,
+    private int maxWait = (int)Math.min(Integer.MAX_VALUE,
         GenericObjectPool.DEFAULT_MAX_WAIT);
     private KeyedObjectPool pool = null;
 

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java?rev=672592&r1=672591&r2=672592&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java Sat
Jun 28 16:16:51 2008
@@ -367,7 +367,7 @@
             conn.createStatement();
             fail("Can't use closed connections");
         } catch(SQLException e) {
-            ; // expected
+            // expected
         }
 
         conn = newConnection();
@@ -584,7 +584,7 @@
         public void run() {
             for(int i=0;i<_iter;i++) {
                 try {
-                    Thread.sleep((long)_random.nextInt(_delay));
+                    Thread.sleep(_random.nextInt(_delay));
                 } catch(Exception e) {
                     // ignored
                 }
@@ -596,7 +596,7 @@
                     stmt = conn.prepareStatement("select 'literal', SYSDATE from dual");
                     rset = stmt.executeQuery();
                     try {
-                        Thread.sleep((long)_random.nextInt(_delay));
+                        Thread.sleep(_random.nextInt(_delay));
                     } catch(Exception e) {
                         // ignored
                     }

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterResultSet.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterResultSet.java?rev=672592&r1=672591&r2=672592&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterResultSet.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TesterResultSet.java Sat Jun
28 16:16:51 2008
@@ -124,23 +124,23 @@
 
     public long getLong(int columnIndex) throws SQLException {
         checkOpen();
-        return (long)columnIndex;
+        return columnIndex;
     }
 
     public float getFloat(int columnIndex) throws SQLException {
         checkOpen();
-        return (float)columnIndex;
+        return columnIndex;
     }
 
     public double getDouble(int columnIndex) throws SQLException {
         checkOpen();
-        return (double)columnIndex;
+        return columnIndex;
     }
 
     /** @deprecated */
     public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
         checkOpen();
-        return new BigDecimal((double)columnIndex);
+        return new BigDecimal(columnIndex);
     }
 
     public byte[] getBytes(int columnIndex) throws SQLException {
@@ -206,23 +206,23 @@
 
     public long getLong(String columnName) throws SQLException {
         checkOpen();
-        return (long)(columnName.hashCode());
+        return columnName.hashCode();
     }
 
     public float getFloat(String columnName) throws SQLException {
         checkOpen();
-        return (float)(columnName.hashCode());
+        return columnName.hashCode();
     }
 
     public double getDouble(String columnName) throws SQLException {
         checkOpen();
-        return (double)(columnName.hashCode());
+        return columnName.hashCode();
     }
 
     /** @deprecated */
     public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
         checkOpen();
-        return new BigDecimal((double)columnName.hashCode());
+        return new BigDecimal(columnName.hashCode());
     }
 
     public byte[] getBytes(String columnName) throws SQLException {
@@ -311,12 +311,12 @@
 
     public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
         checkOpen();
-        return new BigDecimal((double)columnIndex);
+        return new BigDecimal(columnIndex);
     }
 
     public BigDecimal getBigDecimal(String columnName) throws SQLException {
         checkOpen();
-        return new BigDecimal((double)columnName.hashCode());
+        return new BigDecimal(columnName.hashCode());
     }
 
     public boolean isBeforeFirst() throws SQLException {

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java?rev=672592&r1=672591&r2=672592&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/datasources/TestPerUserPoolDataSource.java
Sat Jun 28 16:16:51 2008
@@ -499,7 +499,7 @@
         // serialize
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream out = new ObjectOutputStream(baos);
-        out.writeObject((Serializable)ds);
+        out.writeObject(ds);
         byte[] b = baos.toByteArray();
         out.close();
 



Mime
View raw message