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

@@ -785,7 +785,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
}
private Object sendAndReceiveWithContainer(Message<?> requestMessage) throws JMSException {
Connection connection = this.createConnection();
Connection connection = this.createConnection(); // NOSONAR - closed in ConnectionFactoryUtils.
Session session = null;
Destination replyTo = this.replyContainer.getReplyDestination();
try {
@@ -841,7 +841,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
}
private javax.jms.Message sendAndReceiveWithoutContainer(Message<?> requestMessage) throws JMSException {
Connection connection = this.createConnection();
Connection connection = this.createConnection(); // NOSONAR - closed in ConnectionFactoryUtils.
Session session = null;
Destination replyTo = null;
try {
@@ -1329,7 +1329,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
}
}
private class GatewayReplyListenerContainer extends DefaultMessageListenerContainer {
private static class GatewayReplyListenerContainer extends DefaultMessageListenerContainer {
private volatile Destination replyDestination;
@@ -1421,7 +1421,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
}
}
private final class TimedReply {
private static final class TimedReply {
private final long timeStamp = System.currentTimeMillis();
@@ -1470,6 +1470,7 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
new Date(now + JmsOutboundGateway.this.receiveTimeout));
}
}
}
private class IdleContainerStopper implements Runnable {