Sonar fixes according latest report (#2676)

* Sonar fixes according latest report

* Fix initialization order in the `GatewayMethodInboundMessageMapper`

* Fix mock in the `DelegatingSessionFactoryTests`

* Fix `AbstractRemoteFileOutboundGateway.listFilesInRemoteDir`

* * PR comments

* * Fix `AbstractRemoteFileOutboundGateway.listFilesInRemoteDir` complexity
This commit is contained in:
Artem Bilan
2018-12-22 11:57:35 -05:00
committed by Gary Russell
parent 1943c15afe
commit 81b4ea1bef
9 changed files with 207 additions and 157 deletions

View File

@@ -46,7 +46,7 @@ import org.springframework.web.socket.messaging.SubProtocolHandler;
*/
public final class SubProtocolHandlerRegistry {
private static final Log logger = LogFactory.getLog(SubProtocolHandlerRegistry.class);
private static final Log LOGGER = LogFactory.getLog(SubProtocolHandlerRegistry.class);
private final Map<String, SubProtocolHandler> protocolHandlers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
@@ -69,8 +69,8 @@ public final class SubProtocolHandlerRegistry {
for (SubProtocolHandler handler : protocolHandlers) {
List<String> protocols = handler.getSupportedProtocols();
if (CollectionUtils.isEmpty(protocols)) {
if (logger.isWarnEnabled()) {
logger.warn("No sub-protocols, ignoring handler " + handler);
if (LOGGER.isWarnEnabled()) {
LOGGER.warn("No sub-protocols, ignoring handler " + handler);
}
continue;
}
@@ -153,7 +153,7 @@ public final class SubProtocolHandlerRegistry {
* @return The the {@link List} of supported sub-protocols.
*/
public List<String> getSubProtocols() {
return new ArrayList<String>(this.protocolHandlers.keySet());
return new ArrayList<>(this.protocolHandlers.keySet());
}
}