GH-3549: Clean up more SonarQube smells
Fixes https://github.com/spring-projects/spring-integration/issues/3549
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -394,7 +394,7 @@ public final class TestMailServer {
|
||||
LOGGER.error(IO_EXCEPTION, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // NOSONAR
|
||||
|
||||
void searchReply(String tag) throws IOException {
|
||||
if (seen) {
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user