summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-04-10 07:10:53 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-04-10 07:10:59 +0200
commit7cde100cc6e732b0ff335e6f3de66d97544d06da (patch)
treeb423731d3041430d21419c61d68d565d08fd21e1
parent023dc70e4c10ccba8b4676687d6629a93aa9f058 (diff)
Fix various Sonar warnings
Change-Id: I0883042a80525b72f33e66fdb0d5b9e600dcc713 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java4
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ShutdownHandlerProvider.java2
-rw-r--r--infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java4
-rw-r--r--infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/HttpsConnectorProvider.java4
-rw-r--r--infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessorRegistry.java15
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistry.java2
6 files changed, 14 insertions, 17 deletions
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java
index 98950b2..210408e 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java
@@ -146,12 +146,12 @@ final class ModificationDiff {
final AbstractImmutableDataContainerNode<YangInstanceIdentifier.PathArgument> parentContainerNode =
(AbstractImmutableDataContainerNode) parentData;
- final Map<YangInstanceIdentifier, NormalizedNodeUpdate> updates =
+ final Map<YangInstanceIdentifier, NormalizedNodeUpdate> childUpdates =
parentContainerNode.getChildren().entrySet().stream()
.flatMap(entry -> registry.normalizedUpdates(modification.getId(), entry).stream())
.collect(Collectors.toMap(NormalizedNodeUpdate::getId, update -> update));
- return new ModificationDiff(updates);
+ return new ModificationDiff(childUpdates);
}
}
return EMPTY_DIFF;
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ShutdownHandlerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ShutdownHandlerProvider.java
index 0c649b0..a062ad1 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ShutdownHandlerProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ShutdownHandlerProvider.java
@@ -25,7 +25,7 @@ public class ShutdownHandlerProvider extends ProviderTrait<ShutdownHandler> {
protected ShutdownHandler create() {
final ShutdownHandler handler = new ShutdownHandlerImpl();
// Make sure ShutdownHandler is run on JVM shutdown
- Runtime.getRuntime().addShutdownHook(new Thread((handler::performShutdown)));
+ Runtime.getRuntime().addShutdownHook(new Thread(handler::performShutdown));
return handler;
}
}
diff --git a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java
index e402f04..49e94bb 100644
--- a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java
+++ b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java
@@ -23,7 +23,6 @@ import io.fd.honeycomb.data.init.ShutdownHandler;
import org.opendaylight.controller.config.yang.netconf.mdsal.notification.CapabilityChangeNotificationProducer;
import org.opendaylight.controller.config.yang.netconf.mdsal.notification.NotificationToMdsalWriter;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
@@ -65,8 +64,7 @@ public class NetconfNotificationMapperProvider extends ProviderTrait<NetconfOper
writer.start();
LOG.trace("Initializing CapabilityChangeNotificationProducer");
- final DataTreeChangeListener<Capabilities> publisher =
- new CapabilityChangeNotificationProducer(notificationCollector, dataBroker);
+ new CapabilityChangeNotificationProducer(notificationCollector, dataBroker);
LOG.trace("Providing NetconfNotificationOperationServiceFactory");
NetconfNotificationOperationServiceFactory netconfNotificationOperationServiceFactory =
diff --git a/infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/HttpsConnectorProvider.java b/infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/HttpsConnectorProvider.java
index 5a27bcb..b888192 100644
--- a/infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/HttpsConnectorProvider.java
+++ b/infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/HttpsConnectorProvider.java
@@ -59,10 +59,10 @@ final class HttpsConnectorProvider extends ProviderTrait<ServerConnector> {
URL keystoreURL = getClass().getResource(cfg.restconfKeystore.get());
sslContextFactory.setKeyStorePath(keystoreURL.getPath());
sslContextFactory.setKeyStorePassword(cfg.keystorePassword.get());
- sslContextFactory.setKeyManagerPassword((cfg.keystoreManagerPassword.get()));
+ sslContextFactory.setKeyManagerPassword(cfg.keystoreManagerPassword.get());
URL truststoreURL = getClass().getResource(cfg.restconfTruststore.get());
sslContextFactory.setTrustStorePath(truststoreURL.getPath());
- sslContextFactory.setTrustStorePassword((cfg.truststorePassword.get()));
+ sslContextFactory.setTrustStorePassword(cfg.truststorePassword.get());
// TODO HONEYCOMB-167 make this more configurable
sslContextFactory.setExcludeCipherSuites("SSL_RSA_WITH_DES_CBC_SHA", "SSL_DHE_RSA_WITH_DES_CBC_SHA",
"SSL_DHE_DSS_WITH_DES_CBC_SHA", "SSL_RSA_EXPORT_WITH_RC4_40_MD5",
diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessorRegistry.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessorRegistry.java
index d23cd59..b5057a5 100644
--- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessorRegistry.java
+++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessorRegistry.java
@@ -16,17 +16,16 @@
package io.fd.honeycomb.test.tools;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import static com.google.common.base.Preconditions.checkState;
-import javax.annotation.Nonnull;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
-
-import static com.google.common.base.Preconditions.checkState;
+import javax.annotation.Nonnull;
+import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
/**
* Process yang data from json to BA Objects
@@ -56,7 +55,7 @@ final class YangDataProcessorRegistry {
private YangDataProcessor pickProcessor(final YangInstanceIdentifier yangInstanceIdentifier) {
final List<YangDataProcessor> eligibleProcessors = processors.stream()
- .filter(processors -> processors.canProcess(yangInstanceIdentifier))
+ .filter(processor -> processor.canProcess(yangInstanceIdentifier))
.collect(Collectors.toList());
// canProcess should be exclusive for node type, but just in case
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistry.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistry.java
index d893685..35f1c90 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistry.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistry.java
@@ -202,7 +202,7 @@ final class FlatWriterRegistry implements WriterRegistry {
if (writersData.isEmpty()) {
// If there are no data for current writer, but it is a SubtreeWriter and there are updates to
// its children, still invoke it with its root data
- if (writer instanceof SubtreeWriter<?> && isAffected(((SubtreeWriter<?>) writer), updates)) {
+ if (writer instanceof SubtreeWriter<?> && isAffected((SubtreeWriter<?>) writer, updates)) {
// Provide parent data for SubtreeWriter for further processing
writersData = getParentDataObjectUpdate(ctx, updates, writer);
} else {