Fix findbug NP_NONNULL_PARAM_VIOLATION complains 58/70658/3
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Mon, 9 Apr 2018 13:25:00 +0000 (15:25 +0200)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Mon, 9 Apr 2018 16:15:34 +0000 (18:15 +0200)
Change-Id: I359f4a8c626753e9d5eeb6eb4b2cbd906b28e984
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/testtool/src/main/java/org/opendaylight/protocol/bgp/testtool/TestingListener.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/AbstractTopologyBuilder.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTunnelManagerImpl.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/ServerSessionManager.java
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/config/PCEPTopologyProviderBean.java
pcep/tunnel/tunnel-provider/src/main/java/org/opendaylight/bgpcep/pcep/tunnel/provider/PCEPTunnelClusterSingletonService.java

index 9bbc8ac76c7cb2035a6828413d894344a435ba06..790a23d8152fa4b5682f1a76c6584551d25cc970 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.protocol.bgp.testtool;
 
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.util.List;
 import java.util.concurrent.atomic.LongAdder;
 import org.opendaylight.protocol.bgp.rib.impl.BGPSessionImpl;
@@ -29,7 +30,7 @@ final class TestingListener implements BGPSessionListener {
     private final int nprefixes;
     private final List<String> extCom;
     private final boolean multiPathSupport;
-    private LongAdder messageCounter = new LongAdder();
+    private final LongAdder messageCounter = new LongAdder();
 
     TestingListener(final int nprefixes, final List<String> extCom, final boolean multiPathSupport) {
         this.nprefixes = nprefixes;
@@ -76,6 +77,7 @@ final class TestingListener implements BGPSessionListener {
     }
 
     @Override
+    @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "Unrecognised NullableDecl")
     public ListenableFuture<?> releaseConnection() {
         LOG.info("Client Listener: Connection released.");
         return Futures.immediateFuture(null);
index bc451ed8a0a5404d3e983ee85bf6e448da6b5035..7760801b0fc514e2d8fa9b93aaaa89224026a531 100644 (file)
@@ -15,6 +15,7 @@ import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -151,6 +152,7 @@ public abstract class AbstractTopologyBuilder<T extends Route> implements Cluste
         return this.topology;
     }
 
+    @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "Unrecognised NullableDecl")
     public final synchronized ListenableFuture<Void> close() {
         if (this.closed) {
             LOG.trace("Transaction chain was already closed.");
index 4368d3f5704dcf41a74aa86e567c63c17785a33c..35b2a2a6980f78751a898c173d542adb661e4984 100644 (file)
@@ -21,6 +21,7 @@ import static org.opendaylight.protocol.pcep.pcc.mock.spi.MsgBuilderUtil.updToRp
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.net.InetAddresses;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import io.netty.util.Timeout;
 import io.netty.util.Timer;
 import java.math.BigInteger;
@@ -353,6 +354,7 @@ public final class PCCTunnelManagerImpl implements PCCTunnelManager {
         sendEndOfSynchronization(session, Optional.absent());
     }
 
+    @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF", justification = "Unrecognised NullableDecl")
     private void sendEndOfSynchronization(final PCCSession session, final Optional<SrpIdNumber> operationId) {
         Srp srp = null;
         if (operationId.isPresent()) {
index 448b0ac5c94719e3ea8eec61ee72eb526956311f..0e7af2f1491daab38bd261e96454581346600194 100755 (executable)
@@ -14,6 +14,7 @@ import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
@@ -218,6 +219,7 @@ final class ServerSessionManager implements PCEPSessionListenerFactory, Topology
         return listener.tearDownSession(input);
     }
 
+    @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "Unrecognised NullableDecl")
     synchronized ListenableFuture<Void> closeServiceInstance() {
         if (this.isClosed.getAndSet(true)) {
             LOG.error("Session Manager has already been closed.");
index 949e240dc88fa0f53d105e5a213f8de08293ef1d..f1b7609a60dc3faa16dd9305f70da87769ede8a6 100644 (file)
@@ -12,6 +12,7 @@ import static java.util.Objects.requireNonNull;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.List;
@@ -73,6 +74,7 @@ public final class PCEPTopologyProviderBean implements PCEPTopologyProviderDepen
         }
     }
 
+    @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "Unrecognised NullableDecl")
     synchronized ListenableFuture<Void> closeServiceInstance() {
         if (this.pcepTopoProviderCSS != null) {
             return this.pcepTopoProviderCSS.closeServiceInstance();
@@ -162,6 +164,7 @@ public final class PCEPTopologyProviderBean implements PCEPTopologyProviderDepen
         }
 
         @Override
+        @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "Unrecognised NullableDecl")
         public synchronized ListenableFuture<Void> closeServiceInstance() {
             LOG.info("Close PCEP Topology Provider Singleton Service {}", getIdentifier().getValue());
             if (this.serviceInstantiated) {
index 0bbf0a1f06dc28f741d14b9c33971b12c09249ab..acf586583df363fbe1ac41afcf2ba7de02408d55 100644 (file)
@@ -11,6 +11,7 @@ import static java.util.Objects.requireNonNull;
 
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.util.Dictionary;
 import java.util.Hashtable;
 import javax.annotation.Nonnull;
@@ -97,6 +98,7 @@ public final class PCEPTunnelClusterSingletonService implements ClusterSingleton
     }
 
     @Override
+    @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "Unrecognised NullableDecl")
     public synchronized ListenableFuture<Void> closeServiceInstance() {
         LOG.info("Close Service Instance PCEP Tunnel Topology Provider Singleton Service {}",
                 getIdentifier().getValue());