commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1171824 - in /commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils: ./ handlers/ wrappers/
Date Fri, 16 Sep 2011 22:12:16 GMT
Author: simonetripodi
Date: Fri Sep 16 22:12:15 2011
New Revision: 1171824

URL: http://svn.apache.org/viewvc?rev=1171824&view=rev
Log:
fixed whitespaces complained by checkstyle

Modified:
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AbstractQueryRunner.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AsyncQueryRunner.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BasicRowProcessor.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryLoader.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/AbstractKeyedHandler.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/KeyedHandler.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapHandler.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapListHandler.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ScalarHandler.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AbstractQueryRunner.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AbstractQueryRunner.java?rev=1171824&r1=1171823&r2=1171824&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AbstractQueryRunner.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AbstractQueryRunner.java
Fri Sep 16 22:12:15 2011
@@ -137,7 +137,7 @@ public abstract class AbstractQueryRunne
      * @since DbUtils 1.1
      */
     protected Connection prepareConnection() throws SQLException {
-        if(this.getDataSource() == null) {
+        if (this.getDataSource() == null) {
             throw new SQLException("QueryRunner requires a DataSource to be " +
                 "invoked in this way, or a Connection should be passed in");
         }

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AsyncQueryRunner.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AsyncQueryRunner.java?rev=1171824&r1=1171823&r2=1171824&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AsyncQueryRunner.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/AsyncQueryRunner.java
Fri Sep 16 22:12:15 2011
@@ -101,11 +101,11 @@ public class AsyncQueryRunner extends Ab
 
             try {
                 ret = ps.executeBatch();
-            } catch(SQLException e) {
+            } catch (SQLException e) {
                 rethrow(e, sql, (Object[])params);
             } finally {
                 close(ps);
-                if(closeConn) {
+                if (closeConn) {
                     close(conn);
                 }
             }
@@ -160,19 +160,19 @@ public class AsyncQueryRunner extends Ab
      * @throws SQLException If there are database or parameter errors.
      */
     private Callable<int[]> batch(Connection conn, boolean closeConn, String sql, Object[][]
params) throws SQLException {
-        if(conn == null) {
+        if (conn == null) {
             throw new SQLException("Null connection");
         }
 
-        if(sql == null) {
-            if(closeConn) {
+        if (sql == null) {
+            if (closeConn) {
                 close(conn);
             }
             throw new SQLException("Null SQL statement");
         }
 
-        if(params == null) {
-            if(closeConn) {
+        if (params == null) {
+            if (closeConn) {
                 close(conn);
             }
             throw new SQLException("Null parameters. If parameters aren't need, pass an empty
array.");
@@ -227,14 +227,14 @@ public class AsyncQueryRunner extends Ab
             try {
                 rs = wrap(ps.executeQuery());
                 ret = rsh.handle(rs);
-            } catch(SQLException e) {
+            } catch (SQLException e) {
                 rethrow(e, sql, params);
             } finally {
                 try {
                     close(rs);
                 } finally {
                     close(ps);
-                    if(closeConn) {
+                    if (closeConn) {
                         close(conn);
                     }
                 }
@@ -259,19 +259,19 @@ public class AsyncQueryRunner extends Ab
         PreparedStatement stmt = null;
         Callable<T> ret = null;
 
-        if(conn == null) {
+        if (conn == null) {
             throw new SQLException("Null connection");
         }
 
-        if(sql == null) {
-            if(closeConn) {
+        if (sql == null) {
+            if (closeConn) {
                 close(conn);
             }
             throw new SQLException("Null SQL statement");
         }
 
-        if(rsh == null) {
-            if(closeConn) {
+        if (rsh == null) {
+            if (closeConn) {
                 close(conn);
             }
             throw new SQLException("Null ResultSetHandler");
@@ -285,7 +285,7 @@ public class AsyncQueryRunner extends Ab
 
         } catch (SQLException e) {
             close(stmt);
-            if(closeConn) {
+            if (closeConn) {
                 close(conn);
             }
             this.rethrow(e, sql, params);
@@ -385,7 +385,7 @@ public class AsyncQueryRunner extends Ab
                 rethrow(e, sql, params);
             } finally {
                 close(ps);
-                if(closeConn) {
+                if (closeConn) {
                     close(conn);
                 }
             }
@@ -409,12 +409,12 @@ public class AsyncQueryRunner extends Ab
         PreparedStatement stmt = null;
         Callable<Integer> ret = null;
 
-        if(conn == null) {
+        if (conn == null) {
             throw new SQLException("Null connection");
         }
 
-        if(sql == null) {
-            if(closeConn) {
+        if (sql == null) {
+            if (closeConn) {
                 close(conn);
             }
             throw new SQLException("Null SQL statement");
@@ -428,7 +428,7 @@ public class AsyncQueryRunner extends Ab
 
         } catch (SQLException e) {
             close(stmt);
-            if(closeConn) {
+            if (closeConn) {
                 close(conn);
             }
             this.rethrow(e, sql, params);

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BasicRowProcessor.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BasicRowProcessor.java?rev=1171824&r1=1171823&r2=1171824&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BasicRowProcessor.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BasicRowProcessor.java
Fri Sep 16 22:12:15 2011
@@ -187,7 +187,7 @@ public class BasicRowProcessor implement
          * </ul>
          * </p>
          */
-        private final Map<String,String> lowerCaseMap = new HashMap<String,String>();
+        private final Map<String, String> lowerCaseMap = new HashMap<String, String>();
 
         /**
          * Required for serialization support.
@@ -232,7 +232,7 @@ public class BasicRowProcessor implement
 
         /** {@inheritDoc} */
         @Override
-        public void putAll(Map<? extends String,?> m) {
+        public void putAll(Map<? extends String, ?> m) {
             for (Map.Entry<? extends String, ?> entry : m.entrySet()) {
                 String key = entry.getKey();
                 Object value = entry.getValue();

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=1171824&r1=1171823&r2=1171824&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
Sep 16 22:12:15 2011
@@ -46,7 +46,7 @@ public class QueryLoader {
     /**
      * Maps query set names to Maps of their queries.
      */
-    private final Map<String,Map<String,String>> queries = new HashMap<String,
Map<String,String>>();
+    private final Map<String, Map<String, String>> queries = new HashMap<String,
Map<String, String>>();
 
     /**
      * QueryLoader constructor.
@@ -69,9 +69,9 @@ public class QueryLoader {
      * the given path.
      * @return Map of query names to SQL values
      */
-    public synchronized Map<String,String> load(String path) throws IOException {
+    public synchronized Map<String, String> load(String path) throws IOException {
 
-        Map<String,String> queryMap = this.queries.get(path);
+        Map<String, String> queryMap = this.queries.get(path);
 
         if (queryMap == null) {
             queryMap = this.loadQueries(path);
@@ -91,7 +91,7 @@ public class QueryLoader {
      * @since DbUtils 1.1
      * @return Map of query names to SQL values
      */
-    protected Map<String,String> loadQueries(String path) throws IOException {
+    protected Map<String, String> loadQueries(String path) throws IOException {
         // Findbugs flags getClass().getResource as a bad practice; maybe we should change
the API?
         InputStream in = getClass().getResourceAsStream(path);
 
@@ -105,7 +105,7 @@ public class QueryLoader {
         // Copy to HashMap for better performance
 
         @SuppressWarnings({ "rawtypes", "unchecked" }) // load() always creates <String,String>
entries
-        HashMap<String,String> hashMap = new HashMap(props);
+        HashMap<String, String> hashMap = new HashMap(props);
         return hashMap;
     }
 
@@ -113,7 +113,7 @@ public class QueryLoader {
      * Removes the queries for the given path from the cache.
      * @param path The path that the queries were loaded from.
      */
-    public synchronized void unload(String path){
+    public synchronized void unload(String path) {
         this.queries.remove(path);
     }
 

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java?rev=1171824&r1=1171823&r2=1171824&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java (original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java Fri
Sep 16 22:12:15 2011
@@ -120,19 +120,19 @@ public class QueryRunner extends Abstrac
      * @throws SQLException If there are database or parameter errors.
      */
     private int[] batch(Connection conn, boolean closeConn, String sql, Object[][] params)
throws SQLException {
-        if(conn == null) {
+        if (conn == null) {
             throw new SQLException("Null connection");
         }
 
-        if(sql == null) {
-            if(closeConn) {
+        if (sql == null) {
+            if (closeConn) {
                 close(conn);
             }
             throw new SQLException("Null SQL statement");
         }
 
-        if(params == null) {
-            if(closeConn) {
+        if (params == null) {
+            if (closeConn) {
                 close(conn);
             }
             throw new SQLException("Null parameters. If parameters aren't need, pass an empty
array.");
@@ -153,7 +153,7 @@ public class QueryRunner extends Abstrac
             this.rethrow(e, sql, (Object[])params);
         } finally {
             close(stmt);
-            if(closeConn) {
+            if (closeConn) {
                 close(conn);
             }
         }
@@ -316,19 +316,19 @@ public class QueryRunner extends Abstrac
      * @throws SQLException If there are database or parameter errors.
      */
     private <T> T query(Connection conn, boolean closeConn, String sql, ResultSetHandler<T>
rsh, Object... params) throws SQLException {
-        if(conn == null) {
+        if (conn == null) {
             throw new SQLException("Null connection");
         }
 
-        if(sql == null) {
-            if(closeConn) {
+        if (sql == null) {
+            if (closeConn) {
                 close(conn);
             }
             throw new SQLException("Null SQL statement");
         }
 
-        if(rsh == null) {
-            if(closeConn) {
+        if (rsh == null) {
+            if (closeConn) {
                 close(conn);
             }
             throw new SQLException("Null ResultSetHandler");
@@ -352,7 +352,7 @@ public class QueryRunner extends Abstrac
                 close(rs);
             } finally {
                 close(stmt);
-                if(closeConn)
+                if (closeConn)
                     close(conn);
             }
         }
@@ -464,12 +464,12 @@ public class QueryRunner extends Abstrac
      * @throws SQLException If there are database or parameter errors.
      */
     private int update(Connection conn, boolean closeConn, String sql, Object... params)
throws SQLException {
-        if(conn == null) {
+        if (conn == null) {
             throw new SQLException("Null connection");
         }
 
-        if(sql == null) {
-            if(closeConn) {
+        if (sql == null) {
+            if (closeConn) {
                 close(conn);
             }
             throw new SQLException("Null SQL statement");
@@ -488,7 +488,7 @@ public class QueryRunner extends Abstrac
 
         } finally {
             close(stmt);
-            if(closeConn)
+            if (closeConn)
                 close(conn);
         }
 

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/AbstractKeyedHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/AbstractKeyedHandler.java?rev=1171824&r1=1171823&r2=1171824&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/AbstractKeyedHandler.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/AbstractKeyedHandler.java
Fri Sep 16 22:12:15 2011
@@ -33,7 +33,7 @@ import org.apache.commons.dbutils.Result
  * @see org.apache.commons.dbutils.ResultSetHandler
  * @since DbUtils 1.3
  */
-public abstract class AbstractKeyedHandler<K,V> implements ResultSetHandler<Map<K,V>>
{
+public abstract class AbstractKeyedHandler<K, V> implements ResultSetHandler<Map<K,
V>> {
 
 
     /**
@@ -44,8 +44,8 @@ public abstract class AbstractKeyedHandl
      * @throws SQLException if a database access error occurs
      * @see org.apache.commons.dbutils.ResultSetHandler#handle(java.sql.ResultSet)
      */
-    public Map<K,V> handle(ResultSet rs) throws SQLException {
-        Map<K,V> result = createMap();
+    public Map<K, V> handle(ResultSet rs) throws SQLException {
+        Map<K, V> result = createMap();
         while (rs.next()) {
             result.put(createKey(rs), createRow(rs));
         }
@@ -59,8 +59,8 @@ public abstract class AbstractKeyedHandl
      *
      * @return Map to store records in
      */
-    protected Map<K,V> createMap() {
-        return new HashMap<K,V>();
+    protected Map<K, V> createMap() {
+        return new HashMap<K, V>();
     }
 
     /**

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/KeyedHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/KeyedHandler.java?rev=1171824&r1=1171823&r2=1171824&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/KeyedHandler.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/KeyedHandler.java
Fri Sep 16 22:12:15 2011
@@ -48,7 +48,7 @@ import org.apache.commons.dbutils.RowPro
  * @see org.apache.commons.dbutils.ResultSetHandler
  * @since DbUtils 1.1
  */
-public class KeyedHandler extends AbstractKeyedHandler<Object, Map<String,Object>>
{
+public class KeyedHandler extends AbstractKeyedHandler<Object, Map<String, Object>>
{
 
     /**
      * The RowProcessor implementation to use when converting rows
@@ -147,7 +147,7 @@ public class KeyedHandler extends Abstra
      * @throws SQLException if a database access error occurs
      */
     @Override
-    protected Map<String,Object> createRow(ResultSet rs) throws SQLException {
+    protected Map<String, Object> createRow(ResultSet rs) throws SQLException {
         return this.convert.toMap(rs);
     }
 

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapHandler.java?rev=1171824&r1=1171823&r2=1171824&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapHandler.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapHandler.java
Fri Sep 16 22:12:15 2011
@@ -30,7 +30,7 @@ import org.apache.commons.dbutils.RowPro
  *
  * @see org.apache.commons.dbutils.ResultSetHandler
  */
-public class MapHandler implements ResultSetHandler<Map<String,Object>> {
+public class MapHandler implements ResultSetHandler<Map<String, Object>> {
 
     /**
      * The RowProcessor implementation to use when converting rows
@@ -68,7 +68,7 @@ public class MapHandler implements Resul
      *
      * @see org.apache.commons.dbutils.ResultSetHandler#handle(java.sql.ResultSet)
      */
-    public Map<String,Object> handle(ResultSet rs) throws SQLException {
+    public Map<String, Object> handle(ResultSet rs) throws SQLException {
         return rs.next() ? this.convert.toMap(rs) : null;
     }
 

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapListHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapListHandler.java?rev=1171824&r1=1171823&r2=1171824&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapListHandler.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapListHandler.java
Fri Sep 16 22:12:15 2011
@@ -29,7 +29,7 @@ import org.apache.commons.dbutils.RowPro
  *
  * @see org.apache.commons.dbutils.ResultSetHandler
  */
-public class MapListHandler extends AbstractListHandler<Map<String,Object>> {
+public class MapListHandler extends AbstractListHandler<Map<String, Object>>
{
 
     /**
      * The RowProcessor implementation to use when converting rows
@@ -66,7 +66,7 @@ public class MapListHandler extends Abst
      * @see org.apache.commons.dbutils.handlers.AbstractListHandler#handle(ResultSet)
      */
     @Override
-    protected Map<String,Object> handleRow(ResultSet rs) throws SQLException {
+    protected Map<String, Object> handleRow(ResultSet rs) throws SQLException {
         return this.convert.toMap(rs);
     }
 

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ScalarHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ScalarHandler.java?rev=1171824&r1=1171823&r2=1171824&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ScalarHandler.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ScalarHandler.java
Fri Sep 16 22:12:15 2011
@@ -74,7 +74,7 @@ public class ScalarHandler implements Re
      * @param columnName The name of the column to retrieve from the
      * <code>ResultSet</code>.
      */
-    private ScalarHandler(int columnIndex, String columnName){
+    private ScalarHandler(int columnIndex, String columnName) {
         this.columnIndex = columnIndex;
         this.columnName = columnName;
     }

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=1171824&r1=1171823&r2=1171824&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 Sep 16 22:12:15 2011
@@ -74,7 +74,7 @@ public class SqlNullCheckedResultSet imp
      * Maps normal method names (ie. "getBigDecimal") to the corresponding null
      * Method object (ie. getNullBigDecimal).
      */
-    private static final Map<String,Method> nullMethods = new HashMap<String,Method>();
+    private static final Map<String, Method> nullMethods = new HashMap<String, Method>();
 
     static {
         Method[] methods = SqlNullCheckedResultSet.class.getMethods();



Mime
View raw message