GH-3549: Clean up more SonarQube smells

Fixes https://github.com/spring-projects/spring-integration/issues/3549
This commit is contained in:
trungPa
2021-07-27 22:24:14 +07:00
committed by GitHub
parent 2be6d86ff9
commit 61153578c5
6 changed files with 7 additions and 7 deletions

View File

@@ -573,10 +573,10 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport
ExecutorService executorService = (ExecutorService) this.taskExecutor;
executorService.shutdown();
try {
if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {
if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) { // NOSONAR magic number
logger.debug("Forcing executor shutdown");
executorService.shutdownNow();
if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) {
if (!executorService.awaitTermination(10, TimeUnit.SECONDS)) { // NOSONAR magic number
logger.debug("Executor failed to shutdown");
}
}

View File

@@ -326,7 +326,7 @@ public class UnicastSendingMessageHandler extends
this.ackLatch = new CountDownLatch(1);
this.taskExecutor.execute(this);
try {
this.ackLatch.await(10000, TimeUnit.MILLISECONDS);
this.ackLatch.await(10000, TimeUnit.MILLISECONDS); // NOSONAR magic number
}
catch (@SuppressWarnings("unused") InterruptedException e) {
Thread.currentThread().interrupt();

View File

@@ -347,7 +347,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa
}
this.jdbcTemplate.batchUpdate(getQuery(Query.CREATE_GROUP_TO_MESSAGE),
Arrays.asList(messages),
100,
100, // NOSONAR magic number
(ps, messageToAdd) -> {
String messageId = getKey(messageToAdd.getHeaders().getId());
if (logger.isDebugEnabled()) {

View File

@@ -201,7 +201,7 @@ public abstract class AbstractStompSessionManager implements StompSessionManager
CountDownLatch connectLatch = addStompSessionCallback(currentEpoch);
try {
if (!connectLatch.await(30, TimeUnit.SECONDS)) {
if (!connectLatch.await(30, TimeUnit.SECONDS)) { // NOSONAR magic number
this.logger.error("No response to connection attempt");
if (currentEpoch == this.epoch.get()) {
scheduleReconnect(null);

View File

@@ -394,7 +394,7 @@ public final class TestMailServer {
LOGGER.error(IO_EXCEPTION, e);
}
}
}
} // NOSONAR
void searchReply(String tag) throws IOException {
if (seen) {

View File

@@ -86,7 +86,7 @@ public class OnlyOnceTrigger implements Trigger {
public void await() {
try {
if (!this.latch.await(10000, TimeUnit.MILLISECONDS)) {
if (!this.latch.await(10000, TimeUnit.MILLISECONDS)) { // NOSONAR magic number
throw new IllegalStateException("test latch.await() did not count down");
}
}