This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-dbcp.git


The following commit(s) were added to refs/heads/master by this push:
     new 09d2ca0  Collapse multiple identical catch clauses into one.
09d2ca0 is described below

commit 09d2ca0eba2ce5e5073f65bade51ae74fbfc7965
Author: Gary Gregory <gardgreg...@gmail.com>
AuthorDate: Fri Jan 8 09:56:16 2021 -0500

    Collapse multiple identical catch clauses into one.
---
 .../apache/commons/dbcp2/datasources/InstanceKeyDataSource.java    | 7 -------
 1 file changed, 7 deletions(-)

diff --git 
a/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java 
b/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
index 96ab52b..a2a1b91 100644
--- 
a/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
+++ 
b/src/main/java/org/apache/commons/dbcp2/datasources/InstanceKeyDataSource.java
@@ -24,7 +24,6 @@ import java.nio.charset.StandardCharsets;
 import java.sql.Connection;
 import java.sql.SQLException;
 import java.sql.SQLFeatureNotSupportedException;
-import java.util.NoSuchElementException;
 import java.util.Properties;
 import java.util.logging.Logger;
 
@@ -913,9 +912,6 @@ public abstract class InstanceKeyDataSource implements 
DataSource, Referenceable
         PooledConnectionAndInfo info = null;
         try {
             info = getPooledConnectionAndInfo(userName, userPassword);
-        } catch (final NoSuchElementException e) {
-            closeDueToException(info);
-            throw new SQLException("Cannot borrow connection from pool", e);
         } catch (final RuntimeException | SQLException e) {
             closeDueToException(info);
             throw e;
@@ -950,9 +946,6 @@ public abstract class InstanceKeyDataSource implements 
DataSource, Referenceable
             for (int i = 0; i < 10; i++) { // Bound the number of retries - 
only needed if bad instances return
                 try {
                     info = getPooledConnectionAndInfo(userName, userPassword);
-                } catch (final NoSuchElementException e) {
-                    closeDueToException(info);
-                    throw new SQLException("Cannot borrow connection from 
pool", e);
                 } catch (final RuntimeException | SQLException e) {
                     closeDueToException(info);
                     throw e;

Reply via email to