commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1557574 - in /commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2: PStmtKey.java cpdsadapter/PStmtKeyCPDS.java
Date Sun, 12 Jan 2014 18:01:15 GMT
Author: markt
Date: Sun Jan 12 18:01:15 2014
New Revision: 1557574

URL: http://svn.apache.org/r1557574
Log:
Reduce FindBugs warnings
Use valueOf()

Modified:
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PStmtKey.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKeyCPDS.java

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PStmtKey.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PStmtKey.java?rev=1557574&r1=1557573&r2=1557574&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PStmtKey.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/PStmtKey.java Sun Jan 12 18:01:15
2014
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,25 +22,25 @@ import java.sql.PreparedStatement;
  * A key uniquely identifying {@link PreparedStatement}s.
  */
 public class PStmtKey {
-    
+
     /** SQL defining Prepared or Callable Statement */
     private final String _sql;
-    
+
     /** Result set type */
     private final Integer _resultSetType;
-    
+
     /** Result set concurrency */
     private final Integer _resultSetConcurrency;
-    
+
     /** Database catalog */
     private final String _catalog;
-    
-    /** 
+
+    /**
      *  Statement type. Either STATEMENT_PREPAREDSTMT (PreparedStatement)
-     *  or STATEMENT_CALLABLESTMT (CallableStatement) 
+     *  or STATEMENT_CALLABLESTMT (CallableStatement)
      */
     private final byte _stmtType;
-    
+
     public PStmtKey(String sql) {
         this(sql, null, PoolingConnection.STATEMENT_PREPAREDSTMT);
     }
@@ -48,7 +48,7 @@ public class PStmtKey {
     public PStmtKey(String sql, String catalog) {
         this(sql, catalog, PoolingConnection.STATEMENT_PREPAREDSTMT);
     }
-    
+
     public PStmtKey(String sql, String catalog, byte stmtType) {
         _sql = sql;
         _catalog = catalog;
@@ -64,16 +64,16 @@ public class PStmtKey {
     public PStmtKey(String sql, String catalog, int resultSetType, int resultSetConcurrency)
{
         this(sql, catalog, resultSetType, resultSetConcurrency, PoolingConnection.STATEMENT_PREPAREDSTMT);
     }
-    
+
     public PStmtKey(String sql, String catalog, int resultSetType, int resultSetConcurrency,
byte stmtType) {
         _sql = sql;
         _catalog = catalog;
-        _resultSetType = new Integer(resultSetType);
-        _resultSetConcurrency = new Integer(resultSetConcurrency);
+        _resultSetType = Integer.valueOf(resultSetType);
+        _resultSetConcurrency = Integer.valueOf(resultSetConcurrency);
         _stmtType = stmtType;
     }
 
-    
+
     public String getSql() {
         return _sql;
     }
@@ -98,7 +98,7 @@ public class PStmtKey {
     public boolean equals(Object that) {
         try {
             PStmtKey key = (PStmtKey)that;
-            return( ((null == _sql && null == key._sql) || _sql.equals(key._sql))
&&  
+            return( ((null == _sql && null == key._sql) || _sql.equals(key._sql))
&&
                     ((null == _catalog && null == key._catalog) || _catalog.equals(key._catalog))
&&
                     ((null == _resultSetType && null == key._resultSetType) || _resultSetType.equals(key._resultSetType))
&&
                     ((null == _resultSetConcurrency && null == key._resultSetConcurrency)
|| _resultSetConcurrency.equals(key._resultSetConcurrency)) &&

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKeyCPDS.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKeyCPDS.java?rev=1557574&r1=1557573&r2=1557574&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKeyCPDS.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKeyCPDS.java
Sun Jan 12 18:01:15 2014
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,7 +28,7 @@ public class PStmtKeyCPDS extends PStmtK
     private final Integer _resultSetHoldability;
     private final int _columnIndexes[];
     private final String _columnNames[];
-    
+
     public PStmtKeyCPDS(String sql) {
         super(sql);
         _autoGeneratedKeys = null;
@@ -39,7 +39,7 @@ public class PStmtKeyCPDS extends PStmtK
 
     public PStmtKeyCPDS(String sql, int autoGeneratedKeys) {
         super(sql);
-        _autoGeneratedKeys = new Integer(autoGeneratedKeys);
+        _autoGeneratedKeys = Integer.valueOf(autoGeneratedKeys);
         _resultSetHoldability = null;
         _columnIndexes = null;
         _columnNames = null;
@@ -56,7 +56,7 @@ public class PStmtKeyCPDS extends PStmtK
     public PStmtKeyCPDS(String sql, int resultSetType, int resultSetConcurrency,
             int resultSetHoldability) {
         super(sql, resultSetType, resultSetConcurrency);
-        _resultSetHoldability = new Integer(resultSetHoldability);
+        _resultSetHoldability = Integer.valueOf(resultSetHoldability);
         _autoGeneratedKeys = null;
         _columnIndexes = null;
         _columnNames = null;
@@ -78,7 +78,7 @@ public class PStmtKeyCPDS extends PStmtK
         _columnIndexes = null;
     }
 
-    
+
     public Integer getAutoGeneratedKeys() {
         return _autoGeneratedKeys;
     }



Mime
View raw message