JDBC, JMS, JPA Sonar fixes

This commit is contained in:
Gary Russell
2018-10-26 14:26:43 -04:00
parent 1e66b6b55d
commit 2b9ba714e6
7 changed files with 29 additions and 17 deletions

View File

@@ -1416,11 +1416,11 @@ public class JmsOutboundGateway extends AbstractReplyProducingMessageHandler imp
if (logger.isWarnEnabled()) {
logger.warn("Unexpected error obtaining destination description: " + e.getMessage());
}
return null;
return "";
}
}
else {
return null;
return "";
}
}

View File

@@ -22,6 +22,7 @@ import javax.jms.Destination;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.listener.AbstractMessageListenerContainer;
import org.springframework.jms.listener.DefaultMessageListenerContainer;
import org.springframework.lang.Nullable;
/**
* Factory class for JMS components.
@@ -48,7 +49,9 @@ public final class Jms {
* @param connectionFactory the JMS ConnectionFactory to build on
* @return the {@link JmsPollableMessageChannelSpec} instance
*/
public static JmsPollableMessageChannelSpec<?> pollableChannel(String id, ConnectionFactory connectionFactory) {
public static JmsPollableMessageChannelSpec<?> pollableChannel(@Nullable String id,
ConnectionFactory connectionFactory) {
return new JmsPollableMessageChannelSpec<>(connectionFactory).id(id);
}
@@ -67,7 +70,7 @@ public final class Jms {
* @param connectionFactory the JMS ConnectionFactory to build on
* @return the {@link JmsMessageChannelSpec} instance
*/
public static JmsMessageChannelSpec<?> channel(String id, ConnectionFactory connectionFactory) {
public static JmsMessageChannelSpec<?> channel(@Nullable String id, ConnectionFactory connectionFactory) {
return new JmsMessageChannelSpec<>(connectionFactory)
.id(id);
}
@@ -87,7 +90,7 @@ public final class Jms {
* @param connectionFactory the JMS ConnectionFactory to build on
* @return the {@link JmsPublishSubscribeMessageChannelSpec} instance
*/
public static JmsPublishSubscribeMessageChannelSpec publishSubscribeChannel(String id,
public static JmsPublishSubscribeMessageChannelSpec publishSubscribeChannel(@Nullable String id,
ConnectionFactory connectionFactory) {
return new JmsPublishSubscribeMessageChannelSpec(connectionFactory).id(id);