garydgregory commented on a change in pull request #42:
URL: https://github.com/apache/commons-dbcp/pull/42#discussion_r449915921



##########
File path: src/main/java/org/apache/commons/dbcp2/BasicDataSource.java
##########
@@ -221,6 +221,8 @@ protected static void validateConnectionFactory(final 
PoolableConnectionFactory
      */
     private boolean poolPreparedStatements = false;
 
+    private boolean clearStatementPoolOnReturn = false;

Review comment:
       Let's not continue the bad habit of initializing instance variables to 
their default values.

##########
File path: src/main/java/org/apache/commons/dbcp2/PoolingConnection.java
##########
@@ -65,6 +65,8 @@
     /** Pool of {@link PreparedStatement}s. and {@link CallableStatement}s */
     private KeyedObjectPool<PStmtKey, DelegatingPreparedStatement> pstmtPool;
 
+    private boolean clearStatementPoolOnReturn = false;
+    

Review comment:
       No need to init to default value.
   

##########
File path: src/main/java/org/apache/commons/dbcp2/BasicDataSourceMXBean.java
##########
@@ -131,6 +131,13 @@ default String getDefaultSchema() {
      */
     boolean isPoolPreparedStatements();
 
+    /**
+     * See {@link BasicDataSource#isClearStatementPoolOnReturn()}
+     * 
+     * @return {@link BasicDataSource#isClearStatementPoolOnReturn()}
+     */
+    boolean isClearStatementPoolOnReturn();

Review comment:
       You must use a default method here or this will break binary 
compatibility. 
   Please add a Javadoc `since` tag for any new public or protected methods.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to