You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/05/22 13:53:56 UTC
(commons-dbcp) 05/05: Fix PMD UnnecessaryFullyQualifiedName in LocalXAConnectionFactory
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
commit e85c3ff1b68792670c4861eb62b362979f024a6d
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed May 22 09:50:58 2024 -0400
Fix PMD UnnecessaryFullyQualifiedName in LocalXAConnectionFactory
---
src/changes/changes.xml | 1 +
.../apache/commons/dbcp2/managed/LocalXAConnectionFactory.java | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 538ce766..f2bda653 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -68,6 +68,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="update" dev="ggregory" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in PoolableCallableStatement.</action>
<action type="update" dev="ggregory" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in PoolablePreparedStatement.</action>
<action type="update" dev="ggregory" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in Utils.</action>
+ <action type="update" dev="ggregory" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName in LocalXAConnectionFactory.</action>
<!-- ADD -->
<!-- UPDATE -->
<action type="update" dev="ggregory" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 66 to 69 #360, #371.</action>
diff --git a/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java b/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java
index dbcec228..a4a08b98 100644
--- a/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java
+++ b/src/main/java/org/apache/commons/dbcp2/managed/LocalXAConnectionFactory.java
@@ -200,14 +200,14 @@ public class LocalXAConnectionFactory implements XAConnectionFactory {
connection.setAutoCommit(originalAutoCommit);
// tell the transaction manager we are read only
- return XAResource.XA_RDONLY;
+ return XA_RDONLY;
}
} catch (final SQLException ignored) {
// no big deal
}
// this is a local (one phase) only connection, so we can't prepare
- return XAResource.XA_OK;
+ return XA_OK;
}
/**
@@ -279,7 +279,7 @@ public class LocalXAConnectionFactory implements XAConnectionFactory {
*/
@Override
public synchronized void start(final Xid xid, final int flag) throws XAException {
- if (flag == XAResource.TMNOFLAGS) {
+ if (flag == TMNOFLAGS) {
// first time in this transaction
// make sure we aren't already in another tx
@@ -304,7 +304,7 @@ public class LocalXAConnectionFactory implements XAConnectionFactory {
}
this.currentXid = xid;
- } else if (flag == XAResource.TMRESUME) {
+ } else if (flag == TMRESUME) {
if (!xid.equals(this.currentXid)) {
throw new XAException("Attempting to resume in different transaction: expected " + this.currentXid
+ ", but was " + xid);