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 8b2d1b2f Inline single use variable 8b2d1b2f is described below commit 8b2d1b2f116aef2f0fc3ea4e85abc1ff4992d32e Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Thu Feb 29 09:19:06 2024 -0500 Inline single use variable Better local var name --- .../apache/commons/dbcp2/managed/BasicManagedDataSource.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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 91e644c2..2f7d901c 100644 --- a/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java +++ b/src/main/java/org/apache/commons/dbcp2/managed/BasicManagedDataSource.java @@ -87,16 +87,14 @@ public class BasicManagedDataSource extends BasicDataSource { Class<?> xaDataSourceClass = null; try { xaDataSourceClass = Class.forName(xaDataSource); - } catch (final Exception t) { - final String message = "Cannot load XA data source class '" + xaDataSource + "'"; - throw new SQLException(message, t); + } catch (final Exception e) { + throw new SQLException("Cannot load XA data source class '" + xaDataSource + "'", e); } try { xaDataSourceInstance = (XADataSource) xaDataSourceClass.getConstructor().newInstance(); - } catch (final Exception t) { - final String message = "Cannot create XA data source of class '" + xaDataSource + "'"; - throw new SQLException(message, t); + } catch (final Exception e) { + throw new SQLException("Cannot create XA data source of class '" + xaDataSource + "'", e); } }