Enable spotbugs in singleton-service 01/76901/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 11 Oct 2018 17:49:59 +0000 (19:49 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 11 Oct 2018 17:52:44 +0000 (19:52 +0200)
This fixes up the issues reported and flips enforcement to on.

Change-Id: If2c1b8214a552f791eda8c68da12cafd59ad6a10
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
singleton-service/mdsal-singleton-common-api/pom.xml
singleton-service/mdsal-singleton-dom-impl/pom.xml
singleton-service/mdsal-singleton-dom-impl/src/main/java/org/opendaylight/mdsal/singleton/dom/impl/ServiceInfo.java

index a987559d73abe8257cc6ff1e3936c8052e51b119..52b439c1a8d912b67ff4ca3aa8b18a4e3a355d1e 100644 (file)
                     <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>com.github.spotbugs</groupId>
+                <artifactId>spotbugs-maven-plugin</artifactId>
+                <configuration>
+                    <failOnError>true</failOnError>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 
index 68bb08411808660506367f1b78511b2689545e13..89972308c235dc4e0d6f68c3bc7781b919251519 100644 (file)
                     <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>com.github.spotbugs</groupId>
+                <artifactId>spotbugs-maven-plugin</artifactId>
+                <configuration>
+                    <failOnError>true</failOnError>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 
index f8649764409453d1ee39224124441d476055efec..1b6db564c3fe8ca3139067944ed53e4b2b158855 100644 (file)
@@ -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);