commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject commons-dbcp git commit: Fix DBCP-463
Date Wed, 02 Nov 2016 21:57:21 GMT
Repository: commons-dbcp
Updated Branches:
  refs/heads/master f740290ca -> 8a1c11185


Fix DBCP-463

Correct a typo in the method name
PoolableConnectionFactory#setMaxOpenPreparedStatements. The old method
remains but is deprecated so not to break clients currently using the
incorrect name.

Project: http://git-wip-us.apache.org/repos/asf/commons-dbcp/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbcp/commit/8a1c1118
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbcp/tree/8a1c1118
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbcp/diff/8a1c1118

Branch: refs/heads/master
Commit: 8a1c1118558c8a4ec4d0b972d0c58906eaa3dd87
Parents: f740290
Author: Mark Thomas <markt@apache.org>
Authored: Wed Nov 2 21:55:50 2016 +0000
Committer: Mark Thomas <markt@apache.org>
Committed: Wed Nov 2 21:55:50 2016 +0000

----------------------------------------------------------------------
 src/changes/changes.xml                                        | 6 ++++++
 src/main/java/org/apache/commons/dbcp2/BasicDataSource.java    | 4 ++--
 .../org/apache/commons/dbcp2/PoolableConnectionFactory.java    | 5 +++++
 .../apache/commons/dbcp2/managed/BasicManagedDataSource.java   | 2 +-
 src/test/java/org/apache/commons/dbcp2/TestPoolingDriver.java  | 2 +-
 5 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/8a1c1118/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 92435a5..a3e5daa 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -103,6 +103,12 @@ The <action> type attribute can be add,update,fix,remove.
         Expand the fail-fast for fatal connection errors feature to include
         managed connections.
       </action>
+      <action dev="markt" type="fix" issue="DBCP-463">
+        Correct a typo in the method name
+        PoolableConnectionFactory#setMaxOpenPreparedStatements. The old method
+        remains but is deprecated so not to break clients currently using the
+        incorrect name.
+      </action>
     </release>
     <release version="2.1.1" date="6 Aug 2015" description=
 "This is a patch release, including bug fixes only.">

http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/8a1c1118/src/main/java/org/apache/commons/dbcp2/BasicDataSource.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/BasicDataSource.java b/src/main/java/org/apache/commons/dbcp2/BasicDataSource.java
index 575c4ff..2d6fcad 100644
--- a/src/main/java/org/apache/commons/dbcp2/BasicDataSource.java
+++ b/src/main/java/org/apache/commons/dbcp2/BasicDataSource.java
@@ -2033,7 +2033,7 @@ public class BasicDataSource implements DataSource, BasicDataSourceMXBean,
MBean
                         driverConnectionFactory);
                 poolableConnectionFactory.setPoolStatements(
                         poolPreparedStatements);
-                poolableConnectionFactory.setMaxOpenPrepatedStatements(
+                poolableConnectionFactory.setMaxOpenPreparedStatements(
                         maxOpenPreparedStatements);
                 success = true;
             } catch (final SQLException se) {
@@ -2274,7 +2274,7 @@ public class BasicDataSource implements DataSource, BasicDataSourceMXBean,
MBean
             connectionFactory.setDefaultCatalog(defaultCatalog);
             connectionFactory.setCacheState(cacheState);
             connectionFactory.setPoolStatements(poolPreparedStatements);
-            connectionFactory.setMaxOpenPrepatedStatements(maxOpenPreparedStatements);
+            connectionFactory.setMaxOpenPreparedStatements(maxOpenPreparedStatements);
             connectionFactory.setMaxConnLifetimeMillis(maxConnLifetimeMillis);
             connectionFactory.setRollbackOnReturn(getRollbackOnReturn());
             connectionFactory.setEnableAutoCommitOnReturn(getEnableAutoCommitOnReturn());

http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/8a1c1118/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java b/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
index 68a26c8..8ebe994 100644
--- a/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
+++ b/src/main/java/org/apache/commons/dbcp2/PoolableConnectionFactory.java
@@ -158,7 +158,12 @@ public class PoolableConnectionFactory
         this.poolStatements = poolStatements;
     }
 
+    @Deprecated // Due to typo in method name.
     public void setMaxOpenPrepatedStatements(final int maxOpenPreparedStatements) {
+        setMaxOpenPreparedStatements(maxOpenPreparedStatements);
+    }
+
+    public void setMaxOpenPreparedStatements(final int maxOpenPreparedStatements) {
         this.maxOpenPreparedStatements = maxOpenPreparedStatements;
     }
 

http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/8a1c1118/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java b/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
index 675ef73..220b3a4 100644
--- a/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
+++ b/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java
@@ -195,7 +195,7 @@ public class BasicManagedDataSource extends BasicDataSource {
             connectionFactory.setDefaultCatalog(getDefaultCatalog());
             connectionFactory.setCacheState(getCacheState());
             connectionFactory.setPoolStatements(isPoolPreparedStatements());
-            connectionFactory.setMaxOpenPrepatedStatements(
+            connectionFactory.setMaxOpenPreparedStatements(
                     getMaxOpenPreparedStatements());
             connectionFactory.setMaxConnLifetimeMillis(getMaxConnLifetimeMillis());
             connectionFactory.setRollbackOnReturn(getRollbackOnReturn());

http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/8a1c1118/src/test/java/org/apache/commons/dbcp2/TestPoolingDriver.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/TestPoolingDriver.java b/src/test/java/org/apache/commons/dbcp2/TestPoolingDriver.java
index 7442fa5..00119b6 100644
--- a/src/test/java/org/apache/commons/dbcp2/TestPoolingDriver.java
+++ b/src/test/java/org/apache/commons/dbcp2/TestPoolingDriver.java
@@ -62,7 +62,7 @@ public class TestPoolingDriver extends TestConnectionPool {
 
         final PoolableConnectionFactory pcf = new PoolableConnectionFactory(cf, null);
         pcf.setPoolStatements(true);
-        pcf.setMaxOpenPrepatedStatements(10);
+        pcf.setMaxOpenPreparedStatements(10);
         pcf.setValidationQuery("SELECT COUNT(*) FROM DUAL");
         pcf.setDefaultReadOnly(Boolean.FALSE);
         pcf.setDefaultAutoCommit(Boolean.TRUE);


Mime
View raw message