From 942fe1664278ceedc1db7cf38dde2669738f7f21 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 11 Oct 2018 19:49:59 +0200 Subject: [PATCH] Enable spotbugs in singleton-service This fixes up the issues reported and flips enforcement to on. Change-Id: If2c1b8214a552f791eda8c68da12cafd59ad6a10 Signed-off-by: Robert Varga --- singleton-service/mdsal-singleton-common-api/pom.xml | 7 +++++++ singleton-service/mdsal-singleton-dom-impl/pom.xml | 7 +++++++ .../opendaylight/mdsal/singleton/dom/impl/ServiceInfo.java | 2 ++ 3 files changed, 16 insertions(+) diff --git a/singleton-service/mdsal-singleton-common-api/pom.xml b/singleton-service/mdsal-singleton-common-api/pom.xml index a987559d73..52b439c1a8 100644 --- a/singleton-service/mdsal-singleton-common-api/pom.xml +++ b/singleton-service/mdsal-singleton-common-api/pom.xml @@ -55,6 +55,13 @@ checkstyle.violationSeverity=error + + com.github.spotbugs + spotbugs-maven-plugin + + true + + diff --git a/singleton-service/mdsal-singleton-dom-impl/pom.xml b/singleton-service/mdsal-singleton-dom-impl/pom.xml index 68bb084118..89972308c2 100644 --- a/singleton-service/mdsal-singleton-dom-impl/pom.xml +++ b/singleton-service/mdsal-singleton-dom-impl/pom.xml @@ -61,6 +61,13 @@ checkstyle.violationSeverity=error + + com.github.spotbugs + spotbugs-maven-plugin + + true + + diff --git a/singleton-service/mdsal-singleton-dom-impl/src/main/java/org/opendaylight/mdsal/singleton/dom/impl/ServiceInfo.java b/singleton-service/mdsal-singleton-dom-impl/src/main/java/org/opendaylight/mdsal/singleton/dom/impl/ServiceInfo.java index f864976440..1b6db564c3 100644 --- a/singleton-service/mdsal-singleton-dom-impl/src/main/java/org/opendaylight/mdsal/singleton/dom/impl/ServiceInfo.java +++ b/singleton-service/mdsal-singleton-dom-impl/src/main/java/org/opendaylight/mdsal/singleton/dom/impl/ServiceInfo.java @@ -12,11 +12,13 @@ import static com.google.common.base.Verify.verifyNotNull; import static java.util.Objects.requireNonNull; import com.google.common.util.concurrent.ListenableFuture; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.mdsal.singleton.dom.impl.ClusterSingletonServiceGroupImpl.ServiceState; @NonNullByDefault +@SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_NONVIRTUAL", justification = "SpotBugs does not grok @Nullable field") final class ServiceInfo { private static final ServiceInfo STARTED = new ServiceInfo(ServiceState.STARTED, null); -- 2.36.6