Skip to content

Commit

Permalink
DBCP-589: Upgrade to Jakarta namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinleturc committed Jun 12, 2024
1 parent be358d5 commit e8df4f4
Show file tree
Hide file tree
Showing 21 changed files with 87 additions and 64 deletions.
1 change: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ permissions:

jobs:
build:
if: false

runs-on: ubuntu-latest
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
java: [ 8, 11, 17, 21 ]
java: [ 11, 17, 21 ]
experimental: [false]
# include:
# - java: 22-ea
Expand Down
24 changes: 18 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,19 @@
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<version>1.3.3</version>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>3.0.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
<version>2.0.1</version>
<optional>true</optional>
</dependency>

<!-- tomcat naming jars for jndi reference tests -->
Expand All @@ -117,9 +129,9 @@

<!-- for testing of managed connections -->
<dependency>
<groupId>org.apache.geronimo.modules</groupId>
<groupId>org.apache.geronimo.components</groupId>
<artifactId>geronimo-transaction</artifactId>
<version>2.2.1</version>
<version>4.0.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -146,7 +158,7 @@
</dependency>
<dependency>
<groupId>org.jboss.narayana.jta</groupId>
<artifactId>narayana-jta</artifactId>
<artifactId>narayana-jta-jakarta</artifactId>
<!-- Versions >= 5.13.0 require Java 11 -->
<version>5.12.7.Final</version>
<scope>test</scope>
Expand Down Expand Up @@ -219,7 +231,7 @@
<commons.jacoco.complexityRatio>0.76</commons.jacoco.complexityRatio>
</properties>
<build>
<defaultGoal>clean verify apache-rat:check japicmp:cmp checkstyle:check spotbugs:check pmd:check pmd:cpd-check javadoc:javadoc</defaultGoal>
<defaultGoal>clean verify apache-rat:check checkstyle:check spotbugs:check pmd:check pmd:cpd-check javadoc:javadoc</defaultGoal>
<pluginManagement>
<plugins>
<plugin>
Expand Down Expand Up @@ -330,7 +342,7 @@
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<version>1.3.1</version>
<version>2.0.1</version>
</dependency>
</dependencies>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion src/conf/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<module name="UpperEll" />
<module name="ImportOrder">
<property name="option" value="top"/>
<property name="groups" value="java,javax,org"/>
<property name="groups" value="java,javax,jakarta,org"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

import javax.sql.DataSource;
import javax.sql.XADataSource;
import javax.transaction.TransactionManager;
import javax.transaction.TransactionSynchronizationRegistry;

import jakarta.transaction.TransactionManager;
import jakarta.transaction.TransactionSynchronizationRegistry;

import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.commons.dbcp2.ConnectionFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
import javax.sql.PooledConnection;
import javax.sql.XAConnection;
import javax.sql.XADataSource;
import javax.transaction.TransactionManager;
import javax.transaction.TransactionSynchronizationRegistry;
import javax.transaction.xa.XAResource;

import jakarta.transaction.TransactionManager;
import jakarta.transaction.TransactionSynchronizationRegistry;

import org.apache.commons.dbcp2.Utils;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
import java.sql.SQLException;
import java.util.Objects;

import javax.transaction.TransactionManager;
import javax.transaction.TransactionSynchronizationRegistry;
import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;

import jakarta.transaction.TransactionManager;
import jakarta.transaction.TransactionSynchronizationRegistry;

import org.apache.commons.dbcp2.ConnectionFactory;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package org.apache.commons.dbcp2.managed;

import javax.transaction.Synchronization;
import jakarta.transaction.Synchronization;

/**
* Implements {@link Synchronization} for subclasses.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
import java.sql.SQLException;
import java.util.Objects;

import javax.transaction.RollbackException;
import javax.transaction.Status;
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionSynchronizationRegistry;
import javax.transaction.xa.XAResource;

import jakarta.transaction.RollbackException;
import jakarta.transaction.Status;
import jakarta.transaction.Synchronization;
import jakarta.transaction.SystemException;
import jakarta.transaction.Transaction;
import jakarta.transaction.TransactionSynchronizationRegistry;

/**
* TransactionContext represents the association between a single XAConnectionFactory and a Transaction. This context
* contains a single shared connection which should be used by all ManagedConnections for the XAConnectionFactory, the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
import java.util.Objects;
import java.util.WeakHashMap;

import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import javax.transaction.TransactionSynchronizationRegistry;
import javax.transaction.xa.XAResource;

import jakarta.transaction.SystemException;
import jakarta.transaction.Transaction;
import jakarta.transaction.TransactionManager;
import jakarta.transaction.TransactionSynchronizationRegistry;

import org.apache.commons.dbcp2.DelegatingConnection;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.sql.SQLException;

import javax.sql.XADataSource;
import javax.transaction.TransactionManager;
import javax.transaction.TransactionSynchronizationRegistry;
import javax.transaction.xa.XAException;

import jakarta.transaction.TransactionManager;
import jakarta.transaction.TransactionSynchronizationRegistry;

import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.commons.dbcp2.TestBasicDataSource;
import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.sql.Timestamp;
import java.time.Duration;

import javax.transaction.RollbackException;
import javax.transaction.Status;
import jakarta.transaction.RollbackException;
import jakarta.transaction.Status;

import org.apache.commons.dbcp2.Utils;
import org.junit.jupiter.api.AfterEach;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.time.Duration;
import java.util.Properties;

import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.RollbackException;
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import javax.transaction.xa.XAResource;

import jakarta.transaction.HeuristicMixedException;
import jakarta.transaction.HeuristicRollbackException;
import jakarta.transaction.RollbackException;
import jakarta.transaction.Synchronization;
import jakarta.transaction.SystemException;
import jakarta.transaction.Transaction;
import jakarta.transaction.TransactionManager;

import org.apache.commons.dbcp2.ConnectionFactory;
import org.apache.commons.dbcp2.Constants;
import org.apache.commons.dbcp2.DriverConnectionFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
import java.util.List;
import java.util.Properties;

import javax.transaction.TransactionManager;
import javax.transaction.xa.XAException;

import jakarta.transaction.TransactionManager;

import org.apache.commons.dbcp2.ConnectionFactory;
import org.apache.commons.dbcp2.Constants;
import org.apache.commons.dbcp2.DriverConnectionFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.sql.Connection;
import java.util.Properties;

import javax.transaction.TransactionManager;
import jakarta.transaction.TransactionManager;

import org.apache.commons.dbcp2.ConnectionFactory;
import org.apache.commons.dbcp2.Constants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.sql.SQLException;
import java.sql.Statement;

import javax.transaction.Synchronization;
import javax.transaction.Transaction;
import jakarta.transaction.Synchronization;
import jakarta.transaction.Transaction;

import org.apache.commons.dbcp2.DelegatingConnection;
import org.junit.jupiter.api.AfterEach;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.time.Duration;
import java.util.Properties;

import javax.transaction.TransactionManager;
import jakarta.transaction.TransactionManager;

import org.apache.commons.dbcp2.ConnectionFactory;
import org.apache.commons.dbcp2.Constants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ Licensed to the Apache Software Foundation (ASF) under one or more

import javax.sql.XAConnection;
import javax.sql.XADataSource;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import javax.transaction.TransactionSynchronizationRegistry;
import javax.transaction.xa.XAResource;

import jakarta.transaction.NotSupportedException;
import jakarta.transaction.RollbackException;
import jakarta.transaction.Synchronization;
import jakarta.transaction.SystemException;
import jakarta.transaction.Transaction;
import jakarta.transaction.TransactionManager;
import jakarta.transaction.TransactionSynchronizationRegistry;

import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.commons.dbcp2.DelegatingConnection;
import org.apache.commons.dbcp2.PoolableConnection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@

package org.apache.commons.dbcp2.transaction;

import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.RollbackException;
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.xa.XAResource;

import jakarta.transaction.HeuristicMixedException;
import jakarta.transaction.HeuristicRollbackException;
import jakarta.transaction.RollbackException;
import jakarta.transaction.Synchronization;
import jakarta.transaction.SystemException;
import jakarta.transaction.Transaction;

/**
* A Transaction adapter.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

package org.apache.commons.dbcp2.transaction;

import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.InvalidTransactionException;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import jakarta.transaction.HeuristicMixedException;
import jakarta.transaction.HeuristicRollbackException;
import jakarta.transaction.InvalidTransactionException;
import jakarta.transaction.NotSupportedException;
import jakarta.transaction.RollbackException;
import jakarta.transaction.SystemException;
import jakarta.transaction.Transaction;
import jakarta.transaction.TransactionManager;

/**
* A TransactionManager adapter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

package org.apache.commons.dbcp2.transaction;

import javax.transaction.Synchronization;
import javax.transaction.TransactionSynchronizationRegistry;
import jakarta.transaction.Synchronization;
import jakarta.transaction.TransactionSynchronizationRegistry;

/**
* A TransactionSynchronizationRegistry adapter.
Expand Down

0 comments on commit e8df4f4

Please sign in to comment.