Sonar Fixes

https://sonar.spring.io/component_issues?id=org.springframework.integration%3Aspring-integration%3Amaster#resolved=false|types=BUG

In `IntegrationFlowRegistration` double check locking is ok for `inputChannel`
because we're assigning an existing object, but `MessagingTemplate` constructs
a new object for which double check locking doesn't work.

In any case, for both these items, the chance of concurrent access is extremely low
and is idempotent anyway, so remove double check locking.

Several inner classes can be static.

Other minor fixes.
This commit is contained in:
Gary Russell
2016-11-18 13:34:17 -05:00
committed by Artem Bilan
parent 1bba73fc06
commit f070de0b7e
20 changed files with 63 additions and 64 deletions

View File

@@ -312,7 +312,7 @@ public class TcpOutboundGateway extends AbstractReplyProducingMessageHandler
* before the reply, on a different thread.
*/
logger.debug("second chance");
this.secondChanceLatch.await(2, TimeUnit.SECONDS);
this.secondChanceLatch.await(2, TimeUnit.SECONDS); // NOSONAR don't care about result
waitForMessageAfterError = false;
}
else if (this.reply.getPayload() instanceof MessagingException) {

View File

@@ -905,7 +905,7 @@ public abstract class AbstractConnectionFactory extends IntegrationObjectSupport
+ ", port=" + getPort();
}
private final class PendingIO {
private static final class PendingIO {
private final long failedAt;

View File

@@ -95,7 +95,7 @@ public class CachingClientConnectionFactory extends AbstractClientConnectionFact
* @param poolSize the new pool size.
* @see SimplePool#setPoolSize(int)
*/
public synchronized void setPoolSize(int poolSize) {
public void setPoolSize(int poolSize) {
this.pool.setPoolSize(poolSize);
}