From 8981c90f8979fbb9944dc71e1eac6ca208b8b132 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Fri, 28 Aug 2020 12:29:04 -0400 Subject: [PATCH] Fix new Sonar Issues --- .../amqp/rabbit/test/context/SpringRabbitTest.java | 14 ++++++++------ .../connection/PooledChannelConnectionFactory.java | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/spring-rabbit-test/src/main/java/org/springframework/amqp/rabbit/test/context/SpringRabbitTest.java b/spring-rabbit-test/src/main/java/org/springframework/amqp/rabbit/test/context/SpringRabbitTest.java index 7277cc71..674608eb 100644 --- a/spring-rabbit-test/src/main/java/org/springframework/amqp/rabbit/test/context/SpringRabbitTest.java +++ b/spring-rabbit-test/src/main/java/org/springframework/amqp/rabbit/test/context/SpringRabbitTest.java @@ -23,8 +23,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.amqp.rabbit.junit.RabbitAvailable; - /** * Adds infrastructure beans to a Spring test context; do not use with Spring Boot since * it has its own auto configuration mechanism. @@ -47,25 +45,29 @@ public @interface SpringRabbitTest { } /** - * Set the host when not using {@link RabbitAvailable}. + * Set the host when not using + * {@link org.springframework.amqp.rabbit.junit.RabbitAvailable}. * @return the host. */ String host() default "localhost"; /** - * Set the port when not using {@link RabbitAvailable}. + * Set the port when not using + * {@link org.springframework.amqp.rabbit.junit.RabbitAvailable}. * @return the port. */ int port() default 5672; /** - * Set the user when not using {@link RabbitAvailable}. + * Set the user when not using + * {@link org.springframework.amqp.rabbit.junit.RabbitAvailable}. * @return the user. */ String user() default "guest"; /** - * Set the password when not using {@link RabbitAvailable}. + * Set the password when not using + * {@link org.springframework.amqp.rabbit.junit.RabbitAvailable}. * @return the password. */ String password() default "guest"; diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/PooledChannelConnectionFactory.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/PooledChannelConnectionFactory.java index 14e5aecb..e8df553c 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/PooledChannelConnectionFactory.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/PooledChannelConnectionFactory.java @@ -103,7 +103,7 @@ public class PooledChannelConnectionFactory extends AbstractConnectionFactory { public synchronized Connection createConnection() throws AmqpException { if (this.connection == null || !this.connection.isOpen()) { Connection bareConnection = createBareConnection(); // NOSONAR - see destroy() - this.connection = new ConnectionWrapper(bareConnection.getDelegate(), getCloseTimeout(), + this.connection = new ConnectionWrapper(bareConnection.getDelegate(), getCloseTimeout(), // NOSONAR this.simplePublisherConfirms, this.poolConfigurer); } return this.connection; @@ -118,7 +118,7 @@ public class PooledChannelConnectionFactory extends AbstractConnectionFactory { } } - private final static class ConnectionWrapper extends SimpleConnection { + private static final class ConnectionWrapper extends SimpleConnection { private final ObjectPool channels;