Skip to content

Commit

Permalink
Fix checkstyle for issue eclipse-ee4j#24900 merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
escay committed Sep 5, 2024
1 parent f000acd commit d9d1f62
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package com.sun.enterprise.resource;

import com.sun.enterprise.resource.allocator.ResourceAllocator;

import jakarta.resource.spi.ManagedConnection;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@

package com.sun.enterprise.resource.listener;

import java.util.IdentityHashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.sun.enterprise.connectors.ConnectorRuntime;
import com.sun.enterprise.resource.ResourceHandle;
import com.sun.enterprise.resource.pool.PoolManager;
import com.sun.logging.LogDomains;

import jakarta.resource.spi.ConnectionEvent;
import jakarta.resource.spi.ManagedConnection;

import java.util.IdentityHashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* @author Binod P.G
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ public void resourceClosed(ResourceHandle handle) throws IllegalStateException {

if (state.isUnenlisted() || (poolTxHelper.isNonXAResource(handle) && poolTxHelper.isLocalTransactionInProgress()
&& poolTxHelper.isLocalResourceEligibleForReuse(handle))) {
// Note: the call to isLocalResourceEligibleForReuse can change the enlisted state of the
// Note: the call to isLocalResourceEligibleForReuse can change the enlisted state of the
// handle to false if the resource is eligible for reuse.
freeUnenlistedResource(handle);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public void resourceClosed(ResourceHandle resource) {

if (LOG.isLoggable(Level.FINE)) {
// Warning resource state logged here might not be valid, could be part of another thread already
// but logging the resource id is useful.
// but logging the resource id is useful.
LOG.log(Level.FINE, "PoolManagerImpl.resourceClosed END, resource=" + resource);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@

package com.sun.enterprise.resource.rm;

import java.util.List;
import java.util.ListIterator;
import java.util.logging.Logger;

import org.glassfish.api.invocation.ComponentInvocation;
import org.glassfish.resourcebase.resources.api.PoolInfo;

import com.sun.appserv.connectors.internal.api.PoolingException;
import com.sun.enterprise.connectors.ConnectorRuntime;
import com.sun.enterprise.resource.ResourceHandle;
Expand All @@ -35,6 +28,13 @@
import jakarta.transaction.SystemException;
import jakarta.transaction.Transaction;

import java.util.List;
import java.util.ListIterator;
import java.util.logging.Logger;

import org.glassfish.api.invocation.ComponentInvocation;
import org.glassfish.resourcebase.resources.api.PoolInfo;

import static com.sun.logging.LogDomains.RSR_LOGGER;
import static java.util.logging.Level.WARNING;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,6 @@

package com.sun.enterprise.resource.pool;

import static com.sun.enterprise.resource.pool.ConnectionPoolTest.getPoolInfo;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.createNiceMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.isNull;
import static org.easymock.EasyMock.notNull;
import static org.easymock.EasyMock.replay;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

import com.sun.appserv.connectors.internal.api.ConnectorConstants.PoolType;
import com.sun.appserv.connectors.internal.api.ConnectorRuntimeException;
import com.sun.appserv.connectors.internal.api.PoolingException;
Expand All @@ -46,16 +32,19 @@
import com.sun.enterprise.transaction.api.JavaEETransaction;
import com.sun.enterprise.transaction.api.JavaEETransactionManager;
import com.sun.enterprise.transaction.spi.TransactionalResource;

import jakarta.resource.spi.ManagedConnection;
import jakarta.resource.spi.ManagedConnectionFactory;
import jakarta.transaction.SystemException;
import jakarta.transaction.Transaction;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.glassfish.api.admin.ProcessEnvironment;
import org.glassfish.api.invocation.InvocationManager;
import org.glassfish.api.invocation.InvocationManagerImpl;
Expand All @@ -66,6 +55,20 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static com.sun.enterprise.resource.pool.ConnectionPoolTest.getPoolInfo;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.createNiceMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.isNull;
import static org.easymock.EasyMock.notNull;
import static org.easymock.EasyMock.replay;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

public class PoolManagerImplTest {

// Mocked instances
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.sun.enterprise.transaction.api.XAResourceWrapper;
import com.sun.enterprise.transaction.spi.JavaEETransactionManagerDelegate;
import com.sun.enterprise.transaction.spi.TransactionalResource;

import jakarta.resource.spi.XATerminator;
import jakarta.resource.spi.work.WorkException;
import jakarta.transaction.HeuristicMixedException;
Expand All @@ -30,11 +31,14 @@
import jakarta.transaction.Synchronization;
import jakarta.transaction.SystemException;
import jakarta.transaction.Transaction;

import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.List;

import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;

import org.glassfish.api.invocation.ComponentInvocation;
import org.glassfish.api.invocation.InvocationException;
import org.glassfish.api.invocation.ResourceHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
import com.sun.enterprise.transaction.api.JavaEETransaction;
import com.sun.enterprise.transaction.api.SimpleResource;
import com.sun.enterprise.transaction.spi.TransactionalResource;

import jakarta.persistence.EntityManagerFactory;
import jakarta.transaction.HeuristicMixedException;
import jakarta.transaction.HeuristicRollbackException;
import jakarta.transaction.RollbackException;
import jakarta.transaction.Synchronization;
import jakarta.transaction.SystemException;

import java.util.Set;

import javax.transaction.xa.XAResource;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,7 @@
import com.sun.enterprise.transaction.TransactionSynchronizationRegistryImpl;
import com.sun.enterprise.transaction.UserTransactionImpl;
import com.sun.enterprise.transaction.spi.JavaEETransactionManagerDelegate;
import java.beans.PropertyChangeEvent;
import javax.transaction.xa.XAException;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;

import org.glassfish.api.invocation.InvocationManager;
import org.glassfish.api.naming.SimpleJndiName;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import jakarta.resource.spi.ManagedConnection;
import jakarta.transaction.HeuristicMixedException;
import jakarta.transaction.HeuristicRollbackException;
Expand All @@ -52,6 +43,18 @@
import jakarta.transaction.TransactionSynchronizationRegistry;
import jakarta.transaction.UserTransaction;

import java.beans.PropertyChangeEvent;

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

import org.glassfish.api.invocation.InvocationManager;
import org.glassfish.api.naming.SimpleJndiName;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down

0 comments on commit d9d1f62

Please sign in to comment.