Skip to content

Commit

Permalink
ARTEMIS-5147 eliminate unnecessary check
Browse files Browse the repository at this point in the history
The `transportConnection` variable will always be `null` so there's no
use in checking it.
  • Loading branch information
jbertram authored and tabish121 committed Jan 17, 2025
1 parent d692680 commit c71a164
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.activemq.artemis.core.client.impl;

import java.lang.invoke.MethodHandles;
import java.lang.ref.WeakReference;
import java.security.AccessController;
import java.security.PrivilegedAction;
Expand All @@ -31,6 +32,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.BiPredicate;

import org.apache.activemq.artemis.api.config.ServerLocatorConfig;
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
Expand Down Expand Up @@ -75,8 +77,6 @@
import org.apache.activemq.artemis.utils.collections.ConcurrentHashSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.invoke.MethodHandles;
import java.util.function.BiPredicate;

public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, ClientConnectionLifeCycleListener {

Expand Down Expand Up @@ -1291,13 +1291,6 @@ protected Connection createTransportConnection() {

ActiveMQClientLogger.LOGGER.createConnectorException(cause);

if (transportConnection != null) {
try {
transportConnection.close();
} catch (Throwable t) {
}
}

if (connector != null) {
try {
connector.close();
Expand Down

0 comments on commit c71a164

Please sign in to comment.