commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1557602 - /commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp2/cpdsadapter/PStmtKeyCPDS.java
Date Sun, 12 Jan 2014 19:16:20 GMT
Author: markt
Date: Sun Jan 12 19:16:20 2014
New Revision: 1557602

URL: http://svn.apache.org/r1557602
Log:
Reduce FindBugs warnings
Take defensive copies of client provided arrays

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

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=1557602&r1=1557601&r2=1557602&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 19:16:20 2014
@@ -64,7 +64,7 @@ public class PStmtKeyCPDS extends PStmtK
 
     public PStmtKeyCPDS(String sql, int columnIndexes[]) {
         super(sql);
-        _columnIndexes = columnIndexes;
+        _columnIndexes = Arrays.copyOf(columnIndexes, columnIndexes.length);
         _autoGeneratedKeys = null;
         _resultSetHoldability = null;
         _columnNames = null;
@@ -72,7 +72,7 @@ public class PStmtKeyCPDS extends PStmtK
 
     public PStmtKeyCPDS(String sql, String columnNames[]) {
         super(sql);
-        _columnNames = columnNames;
+        _columnNames = Arrays.copyOf(columnNames, columnNames.length);
         _autoGeneratedKeys = null;
         _resultSetHoldability = null;
         _columnIndexes = null;



Mime
View raw message