From 9224d3446e2b83be89c002673d06db9f477d4c97 Mon Sep 17 00:00:00 2001 From: Gary Russell Date: Fri, 29 Mar 2019 10:11:05 -0400 Subject: [PATCH] Fix new Sonar issue --- .../springframework/amqp/rabbit/core/RabbitAdmin.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitAdmin.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitAdmin.java index 3c9f00b04f..334ceaecd4 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitAdmin.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitAdmin.java @@ -79,6 +79,8 @@ public class RabbitAdmin implements AmqpAdmin, ApplicationContextAware, ApplicationEventPublisherAware, BeanNameAware, InitializingBean { + private static final String UNUSED = "unused"; + private static final int DECLARE_MAX_ATTEMPTS = 5; private static final int DECLARE_INITIAL_RETRY_INTERVAL = 1000; @@ -250,7 +252,7 @@ public boolean deleteExchange(final String exchangeName) { try { channel.exchangeDelete(exchangeName); } - catch (@SuppressWarnings("unused") IOException e) { + catch (@SuppressWarnings(UNUSED) IOException e) { return false; } return true; @@ -315,7 +317,7 @@ public boolean deleteQueue(final String queueName) { try { channel.queueDelete(queueName); } - catch (@SuppressWarnings("unused") IOException e) { + catch (@SuppressWarnings(UNUSED) IOException e) { return false; } return true; @@ -431,11 +433,11 @@ public QueueInformation getQueueInfo(String queueName) { ((ChannelProxy) channel).getTargetChannel().close(); } } - catch (@SuppressWarnings("unused") TimeoutException e1) { + catch (@SuppressWarnings(UNUSED) TimeoutException e1) { } return null; } - catch (@SuppressWarnings("unused") Exception e) { + catch (@SuppressWarnings(UNUSED) Exception e) { if (RabbitAdmin.this.logger.isDebugEnabled()) { RabbitAdmin.this.logger.debug("Queue '" + queueName + "' does not exist"); }