Eliminate jsr305 dependencies 97/82797/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 29 Jun 2019 09:43:53 +0000 (11:43 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 29 Jun 2019 09:43:53 +0000 (11:43 +0200)
Most of the annotations are not needed, as they are already
specified as JDT annotations in implemented interfaces. This
eliminates most annotations (where implied) and migrates them
in fresh uses.

Change-Id: I39af973b710d2c8aa6eac11d53e0ebc23a807533
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
mappingservice/neutron/pom.xml
mappingservice/neutron/src/main/java/org/opendaylight/lispflowmapping/neutron/DelegatingDataTreeListener.java
mappingservice/neutron/src/main/java/org/opendaylight/lispflowmapping/neutron/intenthandler/listener/VbridgeTopologyListener.java
mappingservice/neutron/src/main/java/org/opendaylight/lispflowmapping/neutron/intenthandler/listener/VppEndpointListener.java
mappingservice/neutron/src/main/java/org/opendaylight/lispflowmapping/neutron/intenthandler/listener/service/VbridgeTopologyListenerService.java
mappingservice/neutron/src/main/java/org/opendaylight/lispflowmapping/neutron/intenthandler/util/VppNetconfConnectionProbe.java

index c0851e8689f4ee3417c6bb5453e9fca1503860e0..f4baa1082952c806c262b9f4e8dd8e4438b8af4e 100644 (file)
       <artifactId>mdsal-singleton-common-api</artifactId>
       <version>4.0.2</version>
     </dependency>
-    <dependency>
-      <groupId>com.google.code.findbugs</groupId>
-      <artifactId>jsr305</artifactId>
-      <optional>true</optional>
-    </dependency>
 
     <!--Needed for testing-->
     <dependency>
index 1b31c35a2e35f3c7969b29fc1e3fb6f0de18a161..b5a328d7bed2a8c6d971e8d21b200c1dd53a17dd 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.lispflowmapping.neutron;
 
 import com.google.common.base.Preconditions;
 import java.util.Collection;
-import javax.annotation.Nonnull;
 import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
@@ -52,7 +51,7 @@ public class DelegatingDataTreeListener<T extends DataObject> implements Cluster
     }
 
     @Override
-    public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<T>> changes) {
+    public void onDataTreeChanged(Collection<DataTreeModification<T>> changes) {
         for (DataTreeModification<T> change : changes) {
             DataObjectModification<T> mod = change.getRootNode();
 
index ce9c89eacf68746c59b62b5eeebd776f18da6548..f6a819b1bc0d646347de8f52be7d92b911ab85d4 100644 (file)
@@ -11,7 +11,6 @@ import com.google.common.base.Preconditions;
 import java.util.Collection;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
-import javax.annotation.Nonnull;
 import org.checkerframework.checker.lock.qual.GuardedBy;
 import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
@@ -44,7 +43,7 @@ public class VbridgeTopologyListener implements ClusteredDataTreeChangeListener<
     }
 
     @Override
-    public synchronized void onDataTreeChanged(@Nonnull Collection<DataTreeModification<VbridgeTopology>> changes) {
+    public synchronized void onDataTreeChanged(Collection<DataTreeModification<VbridgeTopology>> changes) {
         for (DataTreeModification<VbridgeTopology> topologyData : changes) {
             final KeyedInstanceIdentifier<Topology, TopologyKey> topologyInstanceIdentifier =
                     (KeyedInstanceIdentifier<Topology, TopologyKey>) topologyData
index aa259826eeafba3214ed7ae30608be48a3afb27a..0c99a36d4d268f8d4be58d00938639e6dd9bf6f5 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.lispflowmapping.neutron.intenthandler.listener;
 
-import com.google.common.base.Function;
 import com.google.common.collect.ArrayListMultimap;
 import com.google.common.collect.Multimap;
 import com.google.common.util.concurrent.FutureCallback;
@@ -20,8 +19,6 @@ import java.util.Collection;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressUtil;
 import org.opendaylight.lispflowmapping.neutron.intenthandler.IntentHandlerAsyncExecutorProvider;
 import org.opendaylight.lispflowmapping.neutron.intenthandler.util.VppNetconfConnectionProbe;
@@ -85,7 +82,7 @@ public class VppEndpointListener implements AutoCloseable, ClusteredDataTreeChan
     }
 
     @Override
-    public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<Topology>> changes) {
+    public void onDataTreeChanged(Collection<DataTreeModification<Topology>> changes) {
         for (DataTreeModification<Topology> change : changes) {
             final DataObjectModification<Topology> modification = change.getRootNode();
             ListenableFuture<Void> modificationTaskHandler;
@@ -106,7 +103,7 @@ public class VppEndpointListener implements AutoCloseable, ClusteredDataTreeChan
             }
             Futures.addCallback(modificationTaskHandler, new FutureCallback<Void>() {
                 @Override
-                public void onSuccess(@Nullable Void vd) {
+                public void onSuccess(Void vd) {
                     LOG.debug("VppEndpoint modification handled successfully!");
                 }
 
@@ -126,7 +123,7 @@ public class VppEndpointListener implements AutoCloseable, ClusteredDataTreeChan
             ListenableFuture<KeyedInstanceIdentifier<Node, NodeKey>> processingTask = processNode(newOrModifiedNode);
             Futures.addCallback(processingTask, new FutureCallback<KeyedInstanceIdentifier<Node, NodeKey>>() {
                 @Override
-                public void onSuccess(@Nullable KeyedInstanceIdentifier<Node, NodeKey> kiiToNode) {
+                public void onSuccess(KeyedInstanceIdentifier<Node, NodeKey> kiiToNode) {
                     hostInformationManager.addHostRelatedInfo(newOrModifiedNode.getNodeId().getValue(),
                             LispAddressUtil.toRloc(vppNodeReader.rlocIpOfNode(kiiToNode)));
                 }
@@ -149,13 +146,8 @@ public class VppEndpointListener implements AutoCloseable, ClusteredDataTreeChan
                 });
 
         return Futures.transform(probeVppNodeForConnection,
-                new Function<Void, KeyedInstanceIdentifier<Node, NodeKey>>() {
-                    @Nullable
-                    @Override
-                    public KeyedInstanceIdentifier<Node, NodeKey> apply(@Nullable Void vd) {
-                        return nodeIdToKeyedInstanceIdentifierMap.get(newOrModifiedNode.getNodeId()).iterator().next();
-                    }
-                }, MoreExecutors.directExecutor());
+                vd -> nodeIdToKeyedInstanceIdentifierMap.get(newOrModifiedNode.getNodeId()).iterator().next(),
+                MoreExecutors.directExecutor());
     }
 
     private void processNodeOnConnection(final Node newOrModifiedNode) {
index 13ae40a18ab0e01191cc89d448cc18634a945038..d695ac428ff8ea1550a0963dfedc6961d349dddc 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.lispflowmapping.neutron.intenthandler.listener.service;
 
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.lispflowmapping.neutron.intenthandler.listener.VbridgeTopologyListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataTreeIdentifier;
@@ -47,8 +47,8 @@ public class VbridgeTopologyListenerService implements AutoCloseable {
         this.closed = false;
     }
 
-    public static VbridgeTopologyListenerService initialize(@Nonnull final DataBroker dataBroker,
-                                                            @Nonnull final MountPointService mountPointService) {
+    public static VbridgeTopologyListenerService initialize(final @NonNull DataBroker dataBroker,
+                                                            final @NonNull MountPointService mountPointService) {
         final ListenerRegistration<VbridgeTopologyListener> reg =
                 dataBroker.registerDataTreeChangeListener(TREE_LISTENER_IDENTIFIER,
                         new VbridgeTopologyListener(dataBroker, mountPointService));
index 08bb09ea95415612280c192ba62c80031b73708b..a16eb7c68a16609ba2dc054516ef855d57354f42 100644 (file)
@@ -19,7 +19,6 @@ import java.util.Collection;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
-import javax.annotation.Nonnull;
 import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.binding.api.DataObjectModification;
@@ -78,7 +77,7 @@ public class VppNetconfConnectionProbe implements ClusteredDataTreeChangeListene
     }
 
     @Override
-    public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<Node>> changes) {
+    public void onDataTreeChanged(Collection<DataTreeModification<Node>> changes) {
         changes.forEach(modification -> {
             final DataObjectModification<Node> rootNode = modification.getRootNode();
             final Node node = rootNode.getDataAfter();