Skip to content

Commit

Permalink
Fix SpotBugs errors.
Browse files Browse the repository at this point in the history
[ERROR] Medium: org.apache.commons.dbcp2.PStmtKey.getColumnNames() may
expose internal representation by returning PStmtKey.columnNames
[org.apache.commons.dbcp2.PStmtKey] At PStmtKey.java:[line 864]
EI_EXPOSE_REP
[ERROR] Medium: org.apache.commons.dbcp2.PoolingDriver.pools is a
mutable collection which should be package protected
[org.apache.commons.dbcp2.PoolingDriver] At PoolingDriver.java:[line 51]
MS_MUTABLE_COLLECTION_PK
  • Loading branch information
Gary Gregory committed May 31, 2021
1 parent d87c0a2 commit e5422ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="ggregory" type="fix">
org.apache.commons.dbcp2.managed.DataSourceXAConnectionFactory.setPassword(char[]) may expose internal representation by storing an externally mutable object into DataSourceXAConnectionFactory.userPassword.
</action>
<action dev="ggregory" type="fix">
org.apache.commons.dbcp2.PStmtKey.getColumnIndexes() may expose internal representation by returning PStmtKey.columnIndexes.
</action>
<action dev="ggregory" type="fix">
org.apache.commons.dbcp2.PStmtKey.getColumnNames() may expose internal representation by returning PStmtKey.columnNames.
</action>
<!-- UPDATES -->
<action dev="ggregory" type="update" due-to="Dependabot">
Bump mockito-core from 3.5.11 to 3.10.0 #66, #72, #77, #85, #91, #105.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/apache/commons/dbcp2/PStmtKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ public String getCatalog() {
* @return An array of column indexes.
*/
public int[] getColumnIndexes() {
return columnIndexes;
return columnIndexes == null ? null : columnIndexes.clone();
}

/**
Expand All @@ -861,7 +861,7 @@ public int[] getColumnIndexes() {
* @return An array of column names.
*/
public String[] getColumnNames() {
return columnNames;
return columnNames == null ? null : columnNames.clone();
}

/**
Expand Down

0 comments on commit e5422ef

Please sign in to comment.