From 211844a4fda1b9ab05732680697ca507e952a285 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 28 Mar 2019 22:46:57 +0100 Subject: [PATCH] Bump odlparent to 5.0.0 This bumps odlparent to 5.0.0, adding JSR305 dependencies where needed. Useless annotations in methods specified by a contract are removed, as SpotBugs reports them (rightfully) as errors, namely NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION, due to Guava using checker.qual instead of JSR305. Change-Id: I7646f5a01b9cf39f7eba316baa8d37c790630c29 Signed-off-by: Robert Varga --- applications/forwardingrules-manager/pom.xml | 15 ++++------- applications/forwardingrules-sync/pom.xml | 5 ++++ .../impl/SyncReactorGuardDecorator.java | 3 +-- .../SyncPlanPushStrategyFlatBatchImpl.java | 3 +-- .../applications/frsync/util/FxChainUtil.java | 3 +-- applications/lldp-speaker/pom.xml | 17 ++++--------- .../ofswitch/config/DefaultConfigPusher.java | 3 +-- applications/reconciliation-framework/pom.xml | 14 ++++------- applications/southbound-cli/pom.xml | 14 ++++------- .../LLDPPacketPuntEnforcer.java | 3 +-- applications/topology-lldp-discovery/pom.xml | 15 ++++------- .../manager/FlowCapableTopologyProvider.java | 2 -- .../manager/NodeChangeListenerImpl.java | 5 ++-- .../TerminationPointChangeListenerImpl.java | 3 +-- artifacts/pom.xml | 2 +- distribution/karaf/pom.xml | 2 +- .../features-openflowplugin-extension/pom.xml | 2 +- .../odl-openflowplugin-nxm-extensions/pom.xml | 2 +- .../odl-openflowplugin-onf-extensions/pom.xml | 2 +- .../features-extension-aggregator/pom.xml | 2 +- .../openflowplugin-extension-nicira/pom.xml | 15 ++++------- .../features-openflowplugin/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-app-topology/pom.xml | 2 +- .../odl-openflowplugin-drop-test/pom.xml | 2 +- .../pom.xml | 2 +- .../odl-openflowplugin-flow-services/pom.xml | 2 +- .../odl-openflowplugin-libraries/pom.xml | 2 +- .../src/main/feature/feature.xml | 2 +- .../odl-openflowplugin-nsf-model/pom.xml | 2 +- .../odl-openflowplugin-southbound/pom.xml | 2 +- features-aggregator/pom.xml | 2 +- libraries/liblldp/pom.xml | 12 +++++---- .../features-openflowjava/pom.xml | 2 +- .../odl-openflowjava-protocol/pom.xml | 2 +- .../features-openflowjava-aggregator/pom.xml | 2 +- openflowjava/openflow-protocol-api/pom.xml | 14 ++++------- openflowjava/openflow-protocol-impl/pom.xml | 25 +++++++++++-------- openflowplugin-api/pom.xml | 5 ++++ openflowplugin-common/pom.xml | 17 +++---------- openflowplugin-impl/pom.xml | 13 +++------- .../impl/OpenFlowPluginProviderImpl.java | 9 +++---- .../impl/connection/HandshakeManagerImpl.java | 5 ++-- .../listener/HandshakeListenerImpl.java | 3 +-- .../impl/device/DeviceContextImpl.java | 2 +- .../initialization/OF10DeviceInitializer.java | 7 +++--- .../initialization/OF13DeviceInitializer.java | 7 +++--- .../lifecycle/ContextChainHolderImpl.java | 5 ++-- .../impl/lifecycle/GuardedContextImpl.java | 5 ++-- .../registry/flow/DeviceFlowRegistryImpl.java | 2 +- .../impl/role/RoleContextImpl.java | 11 ++++---- .../impl/rpc/RpcContextImpl.java | 4 +-- .../AbstractMultipartCollectorService.java | 6 ++--- .../impl/services/RoleService.java | 5 ++-- .../services/batch/FlatBatchFlowAdapters.java | 5 +--- .../batch/FlatBatchGroupAdapters.java | 5 +--- .../batch/FlatBatchMeterAdapters.java | 5 +--- ...ultiLayerExperimenterMultipartService.java | 3 +-- .../multilayer/MultiLayerFlowService.java | 3 +-- .../MultiLayerTableMultipartService.java | 3 +-- .../services/sal/SalBundleServiceImpl.java | 4 +-- .../impl/services/sal/SalFlowServiceImpl.java | 9 +++---- .../services/sal/SalGroupServiceImpl.java | 7 +++--- .../services/sal/SalMeterServiceImpl.java | 8 +++--- ...ngleLayerExperimenterMultipartService.java | 3 +-- .../SingleLayerTableMultipartService.java | 3 +-- .../statistics/StatisticsContextImpl.java | 9 +++---- .../statistics/StatisticsPollingService.java | 4 +-- .../AbstractCompatibleStatService.java | 3 +-- openflowplugin/pom.xml | 12 +++------ samples/learning-switch/pom.xml | 5 ++++ .../SampleFlowCapableNodeListener.java | 3 +-- 83 files changed, 178 insertions(+), 255 deletions(-) diff --git a/applications/forwardingrules-manager/pom.xml b/applications/forwardingrules-manager/pom.xml index 145816c3eb..b0a83529a8 100644 --- a/applications/forwardingrules-manager/pom.xml +++ b/applications/forwardingrules-manager/pom.xml @@ -21,6 +21,11 @@ javax.annotation-api true + + com.google.code.findbugs + jsr305 + true + org.opendaylight.mdsal mdsal-binding-api @@ -60,16 +65,6 @@ infrautils-util ${infrautils.version} - - junit - junit - test - - - org.mockito - mockito-core - test - org.opendaylight.mdsal mdsal-binding-dom-adapter diff --git a/applications/forwardingrules-sync/pom.xml b/applications/forwardingrules-sync/pom.xml index 226e9ca748..d1fceb4083 100644 --- a/applications/forwardingrules-sync/pom.xml +++ b/applications/forwardingrules-sync/pom.xml @@ -16,6 +16,11 @@ javax.annotation-api true + + com.google.code.findbugs + jsr305 + true + org.opendaylight.mdsal diff --git a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorGuardDecorator.java b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorGuardDecorator.java index d90b271a66..91bf600760 100644 --- a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorGuardDecorator.java +++ b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorGuardDecorator.java @@ -13,7 +13,6 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; -import javax.annotation.Nullable; import org.opendaylight.openflowplugin.applications.frsync.SemaphoreKeeper; import org.opendaylight.openflowplugin.applications.frsync.SyncReactor; import org.opendaylight.openflowplugin.applications.frsync.util.PathUtil; @@ -65,7 +64,7 @@ public class SyncReactorGuardDecorator implements SyncReactor { final NodeId nodeId) { return new FutureCallback() { @Override - public void onSuccess(@Nullable final Boolean result) { + public void onSuccess(final Boolean result) { if (LOG.isDebugEnabled()) { final long stampFinished = System.nanoTime(); LOG.debug("Syncup finished {} took:{} rpc:{} wait:{}", nodeId.getValue(), diff --git a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyFlatBatchImpl.java b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyFlatBatchImpl.java index d6749a1cf4..900d7e8b66 100644 --- a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyFlatBatchImpl.java +++ b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyFlatBatchImpl.java @@ -22,7 +22,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.concurrent.Future; -import javax.annotation.Nonnull; import org.opendaylight.openflowplugin.applications.frsync.SyncPlanPushStrategy; import org.opendaylight.openflowplugin.applications.frsync.util.ItemSyncBox; import org.opendaylight.openflowplugin.applications.frsync.util.PathUtil; @@ -161,7 +160,7 @@ public class SyncPlanPushStrategyFlatBatchImpl implements SyncPlanPushStrategy { final SyncCrudCounters counters) { return new FutureCallback>() { @Override - public void onSuccess(@Nonnull final RpcResult result) { + public void onSuccess(final RpcResult result) { if (!result.isSuccessful() && result.getResult() != null && !result.getResult().getBatchFailure().isEmpty()) { Map, Batch> batchMap = mapBatchesToRanges(inputBatchBag, failureIndexLimit); diff --git a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/FxChainUtil.java b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/FxChainUtil.java index 6d936b7b34..3da1068e0b 100644 --- a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/FxChainUtil.java +++ b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/FxChainUtil.java @@ -12,7 +12,6 @@ import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.FutureCallback; import java.util.Collection; -import javax.annotation.Nullable; import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId; import org.opendaylight.yangtools.yang.common.RpcError; import org.opendaylight.yangtools.yang.common.RpcResult; @@ -34,7 +33,7 @@ public final class FxChainUtil { public static FutureCallback> logResultCallback(final NodeId nodeId, final String prefix) { return new FutureCallback>() { @Override - public void onSuccess(@Nullable final RpcResult result) { + public void onSuccess(final RpcResult result) { if (result != null) { if (result.isSuccessful()) { LOG.debug("{} finished successfully: {}", prefix, nodeId.getValue()); diff --git a/applications/lldp-speaker/pom.xml b/applications/lldp-speaker/pom.xml index cc8d5fd840..a366020642 100644 --- a/applications/lldp-speaker/pom.xml +++ b/applications/lldp-speaker/pom.xml @@ -15,6 +15,11 @@ javax.annotation-api true + + com.google.code.findbugs + jsr305 + true + org.opendaylight.openflowplugin openflowplugin-api @@ -54,18 +59,6 @@ infrautils-util ${infrautils.version} - - - - org.mockito - mockito-core - test - - - junit - junit - test - diff --git a/applications/of-switch-config-pusher/src/main/java/org/opendaylight/openflowplugin/openflow/ofswitch/config/DefaultConfigPusher.java b/applications/of-switch-config-pusher/src/main/java/org/opendaylight/openflowplugin/openflow/ofswitch/config/DefaultConfigPusher.java index d8f2d94cda..f6fca45e8a 100644 --- a/applications/of-switch-config-pusher/src/main/java/org/opendaylight/openflowplugin/openflow/ofswitch/config/DefaultConfigPusher.java +++ b/applications/of-switch-config-pusher/src/main/java/org/opendaylight/openflowplugin/openflow/ofswitch/config/DefaultConfigPusher.java @@ -11,7 +11,6 @@ package org.opendaylight.openflowplugin.openflow.ofswitch.config; import com.google.common.base.Preconditions; import java.util.Collection; import java.util.concurrent.Future; -import javax.annotation.Nonnull; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.inject.Inject; @@ -87,7 +86,7 @@ public class DefaultConfigPusher implements AutoCloseable, ClusteredDataTreeChan } @Override - public void onDataTreeChanged(@Nonnull final Collection> modifications) { + public void onDataTreeChanged(final Collection> modifications) { for (DataTreeModification modification : modifications) { if (modification.getRootNode().getModificationType() == ModificationType.WRITE) { String nodeId = modification.getRootPath().getRootIdentifier() diff --git a/applications/reconciliation-framework/pom.xml b/applications/reconciliation-framework/pom.xml index 5d1544d091..f192fada88 100644 --- a/applications/reconciliation-framework/pom.xml +++ b/applications/reconciliation-framework/pom.xml @@ -15,10 +15,6 @@ org.osgi org.osgi.core - - junit - junit - org.opendaylight.mdsal mdsal-binding-api @@ -43,11 +39,6 @@ org.opendaylight.openflowplugin.model model-flow-service - - org.mockito - mockito-core - test - org.opendaylight.mdsal mdsal-binding-dom-adapter @@ -79,6 +70,11 @@ blueprint-maven-plugin-annotation true + + com.google.code.findbugs + jsr305 + true + diff --git a/applications/southbound-cli/pom.xml b/applications/southbound-cli/pom.xml index d83af20ed3..205a5b1f0c 100644 --- a/applications/southbound-cli/pom.xml +++ b/applications/southbound-cli/pom.xml @@ -15,10 +15,6 @@ org.osgi org.osgi.core - - junit - junit - org.opendaylight.mdsal mdsal-binding-api @@ -43,11 +39,6 @@ org.opendaylight.openflowplugin.model model-flow-service - - org.mockito - mockito-core - test - org.opendaylight.mdsal mdsal-binding-dom-adapter @@ -78,6 +69,11 @@ javax.annotation-api true + + com.google.code.findbugs + jsr305 + true + diff --git a/applications/table-miss-enforcer/src/main/java/org/opendaylight/openflowplugin/applications/tablemissenforcer/LLDPPacketPuntEnforcer.java b/applications/table-miss-enforcer/src/main/java/org/opendaylight/openflowplugin/applications/tablemissenforcer/LLDPPacketPuntEnforcer.java index f4eaeea901..344df20684 100644 --- a/applications/table-miss-enforcer/src/main/java/org/opendaylight/openflowplugin/applications/tablemissenforcer/LLDPPacketPuntEnforcer.java +++ b/applications/table-miss-enforcer/src/main/java/org/opendaylight/openflowplugin/applications/tablemissenforcer/LLDPPacketPuntEnforcer.java @@ -14,7 +14,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.concurrent.Future; -import javax.annotation.Nonnull; import org.opendaylight.infrautils.utils.concurrent.JdkFutures; import org.opendaylight.mdsal.binding.api.ClusteredDataTreeChangeListener; import org.opendaylight.mdsal.binding.api.DataBroker; @@ -101,7 +100,7 @@ public class LLDPPacketPuntEnforcer implements AutoCloseable, ClusteredDataTreeC } @Override - public void onDataTreeChanged(@Nonnull final Collection> modifications) { + public void onDataTreeChanged(final Collection> modifications) { for (DataTreeModification modification : modifications) { if (modification.getRootNode().getModificationType() == ModificationType.WRITE) { String nodeId = modification.getRootPath().getRootIdentifier() diff --git a/applications/topology-lldp-discovery/pom.xml b/applications/topology-lldp-discovery/pom.xml index 7ab83ff2c0..d3f4865519 100644 --- a/applications/topology-lldp-discovery/pom.xml +++ b/applications/topology-lldp-discovery/pom.xml @@ -54,16 +54,6 @@ org.opendaylight.controller.model model-inventory - - junit - junit - test - - - org.mockito - mockito-core - test - javax.inject javax.inject @@ -79,6 +69,11 @@ blueprint-maven-plugin-annotation true + + com.google.code.findbugs + jsr305 + true + diff --git a/applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/FlowCapableTopologyProvider.java b/applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/FlowCapableTopologyProvider.java index 6d418c8e2f..83bcb9f81c 100644 --- a/applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/FlowCapableTopologyProvider.java +++ b/applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/FlowCapableTopologyProvider.java @@ -11,7 +11,6 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import java.util.Optional; import java.util.concurrent.ExecutionException; -import javax.annotation.Nonnull; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.inject.Inject; @@ -114,7 +113,6 @@ public class FlowCapableTopologyProvider implements ClusterSingletonService, Aut return Futures.immediateFuture(null); } - @Nonnull @Override public ServiceGroupIdentifier getIdentifier() { return ServiceGroupIdentifier.create(TOPOLOGY_PROVIDER); diff --git a/applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/NodeChangeListenerImpl.java b/applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/NodeChangeListenerImpl.java index 97effc0b26..7e900a614b 100644 --- a/applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/NodeChangeListenerImpl.java +++ b/applications/topology-manager/src/main/java/org/opendaylight/openflowplugin/applications/topology/manager/NodeChangeListenerImpl.java @@ -8,7 +8,6 @@ package org.opendaylight.openflowplugin.applications.topology.manager; import java.util.Collection; -import javax.annotation.Nonnull; import javax.annotation.PreDestroy; import javax.inject.Inject; import javax.inject.Singleton; @@ -41,7 +40,7 @@ public class NodeChangeListenerImpl extends DataTreeChangeListenerImpl> modifications) { + public void onDataTreeChanged(final Collection> modifications) { for (DataTreeModification modification : modifications) { switch (modification.getRootNode().getModificationType()) { case WRITE: @@ -108,4 +107,4 @@ public class NodeChangeListenerImpl extends DataTreeChangeListenerImpl> modifications) { + public void onDataTreeChanged(Collection> modifications) { for (DataTreeModification modification : modifications) { switch (modification.getRootNode().getModificationType()) { case WRITE: diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 2dc32c9b6c..f47744e912 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -13,7 +13,7 @@ org.opendaylight.odlparent odlparent-lite - 4.0.9 + 5.0.0 diff --git a/distribution/karaf/pom.xml b/distribution/karaf/pom.xml index 192c4824a0..04e71863e8 100644 --- a/distribution/karaf/pom.xml +++ b/distribution/karaf/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent karaf4-parent - 4.0.9 + 5.0.0 org.opendaylight.openflowplugin openflowplugin-karaf diff --git a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml index 3a8db4274d..ca49b6355c 100644 --- a/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml +++ b/extension/features-extension-aggregator/features-openflowplugin-extension/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 4.0.9 + 5.0.0 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml index 89e9323e79..ec82360a3f 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-nxm-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml index 289b5415ad..657953b0fb 100644 --- a/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml +++ b/extension/features-extension-aggregator/odl-openflowplugin-onf-extensions/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/extension/features-extension-aggregator/pom.xml b/extension/features-extension-aggregator/pom.xml index 0e6f935822..59ce4da1e3 100644 --- a/extension/features-extension-aggregator/pom.xml +++ b/extension/features-extension-aggregator/pom.xml @@ -3,7 +3,7 @@ org.opendaylight.odlparent odlparent-lite - 4.0.9 + 5.0.0 4.0.0 diff --git a/extension/openflowplugin-extension-nicira/pom.xml b/extension/openflowplugin-extension-nicira/pom.xml index 0663b55a9a..bc39649680 100644 --- a/extension/openflowplugin-extension-nicira/pom.xml +++ b/extension/openflowplugin-extension-nicira/pom.xml @@ -27,6 +27,11 @@ javax.annotation-api true + + com.google.code.findbugs + jsr305 + true + ${project.groupId} openflowplugin-extension-api @@ -62,16 +67,6 @@ openflow-protocol-api - - junit - junit - test - - - org.mockito - mockito-core - test - org.slf4j slf4j-log4j12 diff --git a/features-aggregator/features-openflowplugin/pom.xml b/features-aggregator/features-openflowplugin/pom.xml index 09e32fc45d..ce36f42ed6 100644 --- a/features-aggregator/features-openflowplugin/pom.xml +++ b/features-aggregator/features-openflowplugin/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml index 10cc34b149..51953dbd5a 100644 --- a/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-arbitratorreconciliation/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml index 4a9edd6ecf..8735c93670 100644 --- a/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-bulk-o-matic/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml index 70d92f296f..b5f10aa934 100644 --- a/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-config-pusher/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml index ce300cbc02..4ea025c36e 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml index ae3a4365e5..f677ca8f5f 100644 --- a/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-forwardingrules-sync/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml index 4499d448ee..d63ced50a6 100644 --- a/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-lldp-speaker/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-notifications/pom.xml b/features-aggregator/odl-openflowplugin-app-notifications/pom.xml index d89cd1fc14..f2c914be8e 100644 --- a/features-aggregator/odl-openflowplugin-app-notifications/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-notifications/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml index 44cf884266..247339d611 100644 --- a/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-reconciliation-framework/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml index a92552b20c..ccc46d7e1e 100644 --- a/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-southbound-cli/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml index 209e099bc6..5662feb949 100644 --- a/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-table-miss-enforcer/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml index 51822cf9ac..5cb29745d8 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-lldp-discovery/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml index d77e9549bd..5cff9ad4b1 100644 --- a/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology-manager/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-app-topology/pom.xml b/features-aggregator/odl-openflowplugin-app-topology/pom.xml index 97d9bd1780..b4c1f1db14 100644 --- a/features-aggregator/odl-openflowplugin-app-topology/pom.xml +++ b/features-aggregator/odl-openflowplugin-app-topology/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-drop-test/pom.xml b/features-aggregator/odl-openflowplugin-drop-test/pom.xml index 0458c1bd4f..6785226057 100644 --- a/features-aggregator/odl-openflowplugin-drop-test/pom.xml +++ b/features-aggregator/odl-openflowplugin-drop-test/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml index 1eedea38e9..2b5579cd8a 100644 --- a/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services-rest/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-flow-services/pom.xml b/features-aggregator/odl-openflowplugin-flow-services/pom.xml index 06937e5761..868e18369d 100644 --- a/features-aggregator/odl-openflowplugin-flow-services/pom.xml +++ b/features-aggregator/odl-openflowplugin-flow-services/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-libraries/pom.xml b/features-aggregator/odl-openflowplugin-libraries/pom.xml index c7c8610d46..66f7afc510 100644 --- a/features-aggregator/odl-openflowplugin-libraries/pom.xml +++ b/features-aggregator/odl-openflowplugin-libraries/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-libraries/src/main/feature/feature.xml b/features-aggregator/odl-openflowplugin-libraries/src/main/feature/feature.xml index caa5966092..b07a76fda0 100644 --- a/features-aggregator/odl-openflowplugin-libraries/src/main/feature/feature.xml +++ b/features-aggregator/odl-openflowplugin-libraries/src/main/feature/feature.xml @@ -1,6 +1,6 @@ - odl-guava + odl-guava diff --git a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml index 1709da3079..a05e79034a 100644 --- a/features-aggregator/odl-openflowplugin-nsf-model/pom.xml +++ b/features-aggregator/odl-openflowplugin-nsf-model/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/odl-openflowplugin-southbound/pom.xml b/features-aggregator/odl-openflowplugin-southbound/pom.xml index aaeedffb64..bbb1f7a63c 100644 --- a/features-aggregator/odl-openflowplugin-southbound/pom.xml +++ b/features-aggregator/odl-openflowplugin-southbound/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/features-aggregator/pom.xml b/features-aggregator/pom.xml index 3f9c7f0084..621d1df37a 100644 --- a/features-aggregator/pom.xml +++ b/features-aggregator/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 4.0.9 + 5.0.0 diff --git a/libraries/liblldp/pom.xml b/libraries/liblldp/pom.xml index 2cf864d513..ce5678c973 100644 --- a/libraries/liblldp/pom.xml +++ b/libraries/liblldp/pom.xml @@ -18,10 +18,6 @@ javax.annotation-api true - - junit - junit - org.apache.commons commons-lang3 @@ -43,6 +39,11 @@ javax.xml.bind jaxb-api + + com.google.code.findbugs + jsr305 + true + @@ -54,7 +55,8 @@ - org.opendaylight.openflowplugin.libraries.liblldp + org.opendaylight.openflowplugin.libraries.liblldp + diff --git a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml index cc7f864870..329a44575e 100644 --- a/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/features-openflowjava/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent feature-repo-parent - 4.0.9 + 5.0.0 diff --git a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml index 0d8d048bad..24997193ef 100644 --- a/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/odl-openflowjava-protocol/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent single-feature-parent - 4.0.9 + 5.0.0 diff --git a/openflowjava/features-openflowjava-aggregator/pom.xml b/openflowjava/features-openflowjava-aggregator/pom.xml index 2e916906b4..5a77524478 100644 --- a/openflowjava/features-openflowjava-aggregator/pom.xml +++ b/openflowjava/features-openflowjava-aggregator/pom.xml @@ -4,7 +4,7 @@ org.opendaylight.odlparent odlparent-lite - 4.0.9 + 5.0.0 diff --git a/openflowjava/openflow-protocol-api/pom.xml b/openflowjava/openflow-protocol-api/pom.xml index 1215163f7d..0e7028d9d4 100644 --- a/openflowjava/openflow-protocol-api/pom.xml +++ b/openflowjava/openflow-protocol-api/pom.xml @@ -45,20 +45,16 @@ io.netty netty-buffer - - junit - junit - test - - - org.mockito - mockito-core - org.opendaylight.infrautils diagstatus-api ${infrautils.version} compile + + com.google.code.findbugs + jsr305 + true + diff --git a/openflowjava/openflow-protocol-impl/pom.xml b/openflowjava/openflow-protocol-impl/pom.xml index c029de5f1f..7604840101 100644 --- a/openflowjava/openflow-protocol-impl/pom.xml +++ b/openflowjava/openflow-protocol-impl/pom.xml @@ -15,13 +15,22 @@ https://wiki.opendaylight.org/view/Openflow_Protocol_Library:Main HEAD - + org.apache.aries.blueprint blueprint-maven-plugin + + + + org.opendaylight.openflowjava + + + org.apache.felix @@ -104,20 +113,16 @@ diagstatus-api ${infrautils.version} - - junit - junit - test - - - org.mockito - mockito-core - io.netty netty-transport-native-epoll linux-x86_64 + + com.google.code.findbugs + jsr305 + true + diff --git a/openflowplugin-api/pom.xml b/openflowplugin-api/pom.xml index ccf2d5f596..d246e39b8e 100644 --- a/openflowplugin-api/pom.xml +++ b/openflowplugin-api/pom.xml @@ -55,6 +55,11 @@ org.opendaylight.mdsal mdsal-eos-binding-api + + com.google.code.findbugs + jsr305 + true + diff --git a/openflowplugin-common/pom.xml b/openflowplugin-common/pom.xml index f15af0f0d6..2d2898c38d 100644 --- a/openflowplugin-common/pom.xml +++ b/openflowplugin-common/pom.xml @@ -22,25 +22,16 @@ com.google.guava guava - - org.slf4j - slf4j-api - org.opendaylight.mdsal mdsal-binding-api - - junit - junit - test - - - org.mockito - mockito-core - test + com.google.code.findbugs + jsr305 + true + org.slf4j slf4j-log4j12 diff --git a/openflowplugin-impl/pom.xml b/openflowplugin-impl/pom.xml index ac937d7de4..321e032554 100644 --- a/openflowplugin-impl/pom.xml +++ b/openflowplugin-impl/pom.xml @@ -94,14 +94,9 @@ true - junit - junit - test - - - org.mockito - mockito-core - test + com.google.code.findbugs + jsr305 + true org.slf4j @@ -118,7 +113,7 @@ org.osgi - org.osgi.compendium + osgi.cmpn org.opendaylight.openflowplugin diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java index e3e6cbf98b..9367ebba4c 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/OpenFlowPluginProviderImpl.java @@ -26,7 +26,6 @@ import java.util.concurrent.SynchronousQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.inject.Inject; @@ -179,14 +178,14 @@ public class OpenFlowPluginProviderImpl implements return switchConnectionProvider.startup(); }).collect(Collectors.toSet())), new FutureCallback>() { @Override - public void onSuccess(@Nonnull final List result) { + public void onSuccess(final List result) { LOG.info("All switchConnectionProviders are up and running ({}).", result.size()); openflowDiagStatusProvider.reportStatus(OPENFLOW_SERVICE_NAME, ServiceState.OPERATIONAL); fullyStarted.set(null); } @Override - public void onFailure(@Nonnull final Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.warn("Some switchConnectionProviders failed to start.", throwable); openflowDiagStatusProvider.reportStatus(OPENFLOW_SERVICE_NAME, throwable); fullyStarted.setException(throwable); @@ -213,12 +212,12 @@ public class OpenFlowPluginProviderImpl implements Futures.addCallback(listListenableFuture, new FutureCallback>() { @Override - public void onSuccess(@Nonnull final List result) { + public void onSuccess(final List result) { LOG.info("All switchConnectionProviders were successfully shut down ({}).", result.size()); } @Override - public void onFailure(@Nonnull final Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.warn("Some switchConnectionProviders failed to shutdown.", throwable); } }, MoreExecutors.directExecutor()); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/HandshakeManagerImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/HandshakeManagerImpl.java index 2e8a92e65f..32b3b615a3 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/HandshakeManagerImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/HandshakeManagerImpl.java @@ -18,7 +18,6 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.List; import java.util.Objects; import java.util.concurrent.Future; -import javax.annotation.Nonnull; import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter; import org.opendaylight.openflowplugin.api.OFConstants; import org.opendaylight.openflowplugin.api.openflow.md.core.ErrorHandler; @@ -336,7 +335,7 @@ public class HandshakeManagerImpl implements HandshakeManager { = JdkFutureAdapters.listenInPoolThread(helloResult); Futures.addCallback(rpcResultListenableFuture, new FutureCallback>() { @Override - public void onSuccess(@Nonnull RpcResult result) { + public void onSuccess(RpcResult result) { if (result.isSuccessful()) { LOG.debug("hello successfully sent, xid={}, addr={}", helloXid, connectionAdapter.getRemoteAddress()); @@ -388,7 +387,7 @@ public class HandshakeManagerImpl implements HandshakeManager { Futures.addCallback(JdkFutureAdapters.listenInPoolThread(featuresFuture), new FutureCallback>() { @Override - public void onSuccess(@Nonnull RpcResult rpcFeatures) { + public void onSuccess(RpcResult rpcFeatures) { LOG.trace("features are back"); if (rpcFeatures.isSuccessful()) { GetFeaturesOutput featureOutput = rpcFeatures.getResult(); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImpl.java index d8b41b16fe..a29921a0ed 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/listener/HandshakeListenerImpl.java @@ -13,7 +13,6 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.JdkFutureAdapters; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; -import javax.annotation.Nullable; import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext; import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionStatus; import org.opendaylight.openflowplugin.api.openflow.connection.HandshakeContext; @@ -69,7 +68,7 @@ public class HandshakeListenerImpl implements HandshakeListener { return new FutureCallback>() { @Override @SuppressWarnings("checkstyle:IllegalCatch") - public void onSuccess(@Nullable final RpcResult result) { + public void onSuccess(final RpcResult result) { if (LOG.isDebugEnabled()) { LOG.debug("succeeded by getting sweep barrier after post-handshake for device {}", connectionContext.getDeviceInfo()); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java index 5db42592c0..4f660f55b4 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java @@ -715,7 +715,7 @@ public class DeviceContextImpl implements DeviceContext, ExtensionConverterProvi } @Override - public void onSuccess(@Nullable List> result) { + public void onSuccess(List> result) { if (LOG.isDebugEnabled()) { // Count all flows we read from datastore for debugging purposes. // This number do not always represent how many flows were actually added diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/initialization/OF10DeviceInitializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/initialization/OF10DeviceInitializer.java index 1e04acbf23..b6a0cc6393 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/initialization/OF10DeviceInitializer.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/initialization/OF10DeviceInitializer.java @@ -71,7 +71,7 @@ public class OF10DeviceInitializer extends AbstractDeviceInitializer { Futures.addCallback(future, new FutureCallback() { @Override - public void onSuccess(@Nullable final Boolean result) { + public void onSuccess(final Boolean result) { if (Boolean.TRUE.equals(result)) { LOG.debug("Creating empty flow capable node: {}", deviceInfo); makeEmptyFlowCapableNode(deviceContext, deviceInfo); @@ -85,16 +85,15 @@ public class OF10DeviceInitializer extends AbstractDeviceInitializer { } @Override - public void onFailure(@Nonnull final Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.warn("Error occurred in preparation node {} for protocol 1.0", deviceInfo); LOG.trace("Error for node {} : ", deviceInfo, throwable); } }, MoreExecutors.directExecutor()); return Futures.transform(future, new Function() { - @Nullable @Override - public Void apply(@Nullable final Boolean input) { + public Void apply(final Boolean input) { LOG.debug("Writing physical port information for {}", deviceInfo); writePhyPortInformation(deviceContext); return null; diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/initialization/OF13DeviceInitializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/initialization/OF13DeviceInitializer.java index a7fcb69397..c954e0580e 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/initialization/OF13DeviceInitializer.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/initialization/OF13DeviceInitializer.java @@ -82,9 +82,8 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer { return Futures.transform( switchFeaturesMandatory ? Futures.allAsList(futures) : Futures.successfulAsList(futures), new Function>>, Void>() { - @Nullable @Override - public Void apply(@Nullable final List>> input) { + public Void apply(final List>> input) { LOG.info("Static node {} successfully finished collecting", deviceContext.getDeviceInfo()); return null; @@ -135,7 +134,7 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer { @Nullable final ConvertorExecutor convertorExecutor) { Futures.addCallback(future, new FutureCallback>>() { @Override - public void onSuccess(@Nonnull final RpcResult> result) { + public void onSuccess(final RpcResult> result) { if (result.getResult() != null) { LOG.info("Static node {} info: {} collected", deviceContext.getDeviceInfo(), type); translateAndWriteResult( @@ -164,7 +163,7 @@ public class OF13DeviceInitializer extends AbstractDeviceInitializer { } @Override - public void onFailure(@Nonnull final Throwable throwable) { + public void onFailure(final Throwable throwable) { LOG.warn("Request of type {} for static info of node {} failed.", type, deviceContext.getDeviceInfo()); } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainHolderImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainHolderImpl.java index c8732d48fe..56045af709 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainHolderImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainHolderImpl.java @@ -24,7 +24,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange; import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipListenerRegistration; import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService; @@ -344,7 +343,7 @@ public class ContextChainHolderImpl implements ContextChainHolder, MasterChecker ContextChain contextChain) { return new FutureCallback() { @Override - public void onSuccess(@Nullable ResultState result) { + public void onSuccess(ResultState result) { if (ResultState.DONOTHING == result) { LOG.info("Device {} connection is enabled by reconciliation framework.", deviceInfo); contextChain.continueInitializationAfterReconciliation(); @@ -355,7 +354,7 @@ public class ContextChainHolderImpl implements ContextChainHolder, MasterChecker } @Override - public void onFailure(@Nonnull Throwable throwable) { + public void onFailure(Throwable throwable) { LOG.warn("Reconciliation framework failure."); destroyContextChain(deviceInfo); } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/GuardedContextImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/GuardedContextImpl.java index fc7cf9ef2f..9c1ff0fc32 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/GuardedContextImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/GuardedContextImpl.java @@ -23,7 +23,6 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.Service; import java.util.function.Function; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier; import org.opendaylight.openflowplugin.api.openflow.OFPContext; import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo; @@ -106,12 +105,12 @@ public class GuardedContextImpl implements GuardedContext { Futures.addCallback(resultFuture, new FutureCallback() { @Override - public void onSuccess(@Nullable final Object result) { + public void onSuccess(final Object result) { state = TERMINATED; } @Override - public void onFailure(@Nonnull final Throwable throwable) { + public void onFailure(final Throwable throwable) { state = TERMINATED; } }, MoreExecutors.directExecutor()); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/registry/flow/DeviceFlowRegistryImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/registry/flow/DeviceFlowRegistryImpl.java index 3e248ae40f..8940655b55 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/registry/flow/DeviceFlowRegistryImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/registry/flow/DeviceFlowRegistryImpl.java @@ -127,7 +127,7 @@ public class DeviceFlowRegistryImpl implements DeviceFlowRegistry { future.addCallback(new FutureCallback>() { @Override - public void onSuccess(@Nonnull Optional result) { + public void onSuccess(Optional result) { result.map(Collections::singleton).orElse(Collections.emptySet()).stream() .filter(Objects::nonNull) .filter(flowCapableNode -> Objects.nonNull(flowCapableNode.getTable())) diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/role/RoleContextImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/role/RoleContextImpl.java index 9b6010943b..eeb939c153 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/role/RoleContextImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/role/RoleContextImpl.java @@ -22,7 +22,6 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier; import org.opendaylight.openflowplugin.api.OFConstants; import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo; @@ -180,7 +179,7 @@ public class RoleContextImpl implements RoleContext { private final class MasterRoleCallback implements FutureCallback> { @Override - public void onSuccess(@Nullable RpcResult setRoleOutputRpcResult) { + public void onSuccess(RpcResult setRoleOutputRpcResult) { contextChainMastershipWatcher.onMasterRoleAcquired( deviceInfo, ContextChainMastershipState.MASTER_ON_DEVICE); @@ -188,7 +187,7 @@ public class RoleContextImpl implements RoleContext { } @Override - public void onFailure(@Nonnull final Throwable throwable) { + public void onFailure(final Throwable throwable) { if (!(throwable instanceof CancellationException)) { contextChainMastershipWatcher.onNotAbleToStartMastershipMandatory( deviceInfo, @@ -199,17 +198,17 @@ public class RoleContextImpl implements RoleContext { private final class SlaveRoleCallback implements FutureCallback> { @Override - public void onSuccess(@Nullable final RpcResult result) { + public void onSuccess(final RpcResult result) { contextChainMastershipWatcher.onSlaveRoleAcquired(deviceInfo); LOG.debug("Role SLAVE was successfully set on device, node {}", deviceInfo); } @Override - public void onFailure(@Nonnull final Throwable throwable) { + public void onFailure(final Throwable throwable) { if (!(throwable instanceof CancellationException)) { contextChainMastershipWatcher.onSlaveRoleNotAcquired(deviceInfo, "Was not able to propagate SLAVE role on device. Error: " + throwable.toString()); } } } -} \ No newline at end of file +} diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java index 93e26c0523..d00057213d 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/rpc/RpcContextImpl.java @@ -20,7 +20,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Semaphore; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.opendaylight.mdsal.binding.api.NotificationPublishService; import org.opendaylight.mdsal.binding.api.RpcProviderService; import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier; @@ -179,9 +178,8 @@ class RpcContextImpl implements RpcContext { @Override public ListenableFuture closeServiceInstance() { return Futures.transform(Futures.immediateFuture(null), new Function() { - @Nullable @Override - public Void apply(@Nullable final Void input) { + public Void apply(final Void input) { unregisterRPCs(); return null; } diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractMultipartCollectorService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractMultipartCollectorService.java index 5d5a2eca93..cb4f1538b5 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractMultipartCollectorService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/AbstractMultipartCollectorService.java @@ -9,8 +9,6 @@ package org.opendaylight.openflowplugin.impl.services; import com.google.common.util.concurrent.FutureCallback; import java.util.List; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; @@ -34,12 +32,12 @@ public abstract class AbstractMultipartCollectorService return new FutureCallback() { @Override - public void onSuccess(@Nullable final OfHeader result) { + public void onSuccess(final OfHeader result) { callback.onSuccess(result); } @Override - public void onFailure(@Nonnull final Throwable throwable) { + public void onFailure(final Throwable throwable) { // If we failed getting table features, at least create empty tables if (MultipartType.OFPMPTABLEFEATURES.getClass().equals(requestType)) { DeviceInitializationUtil.makeEmptyTables( diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/RoleService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/RoleService.java index d2e0a4b865..ff642d7366 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/RoleService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/RoleService.java @@ -16,7 +16,6 @@ import java.math.BigInteger; import java.util.Collection; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; -import javax.annotation.Nonnull; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; import org.opendaylight.openflowplugin.api.openflow.device.Xid; @@ -68,7 +67,7 @@ public class RoleService extends AbstractSimpleService>() { @Override - public void onSuccess(@Nonnull final RpcResult roleRequestOutputRpcResult) { + public void onSuccess(final RpcResult roleRequestOutputRpcResult) { if (roleRequestOutputRpcResult.isSuccessful()) { final RoleRequestOutput roleRequestOutput = roleRequestOutputRpcResult.getResult(); if (roleRequestOutput != null) { @@ -114,7 +113,7 @@ public class RoleService extends AbstractSimpleService> finalFuture = SettableFuture.create(); Futures.addCallback(roleListenableFuture, new FutureCallback>() { @Override - public void onSuccess(@Nonnull final RpcResult roleRequestOutputRpcResult) { + public void onSuccess(final RpcResult roleRequestOutputRpcResult) { LOG.info("submitRoleChange onSuccess for device:{}, role:{}", getDeviceInfo().getNodeId(), ofpRole); final RoleRequestOutput roleRequestOutput = roleRequestOutputRpcResult.getResult(); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchFlowAdapters.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchFlowAdapters.java index df79846980..9c634b3041 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchFlowAdapters.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchFlowAdapters.java @@ -17,8 +17,6 @@ import com.google.common.util.concurrent.MoreExecutors; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Future; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.ProcessFlatBatchOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.ProcessFlatBatchOutputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.add.flow._case.FlatBatchAddFlow; @@ -131,9 +129,8 @@ public final class FlatBatchFlowAdapters { static Function, RpcResult> convertBatchFlowResult(final int stepOffset) { return new Function, RpcResult>() { - @Nullable @Override - public RpcResult apply(@Nonnull final RpcResult input) { + public RpcResult apply(final RpcResult input) { List batchFailures = wrapBatchFlowFailuresForFlat(input, stepOffset); ProcessFlatBatchOutputBuilder outputBuilder = new ProcessFlatBatchOutputBuilder().setBatchFailure(batchFailures); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchGroupAdapters.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchGroupAdapters.java index 4f7e8ebd40..c0de5ebaa9 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchGroupAdapters.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchGroupAdapters.java @@ -17,8 +17,6 @@ import com.google.common.util.concurrent.MoreExecutors; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Future; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.ProcessFlatBatchOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.ProcessFlatBatchOutputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.add.group._case.FlatBatchAddGroup; @@ -130,9 +128,8 @@ public final class FlatBatchGroupAdapters { static Function, RpcResult> convertBatchGroupResult(final int stepOffset) { return new Function, RpcResult>() { - @Nullable @Override - public RpcResult apply(@Nonnull final RpcResult input) { + public RpcResult apply(final RpcResult input) { List batchFailures = wrapBatchGroupFailuresForFlat(input, stepOffset); ProcessFlatBatchOutputBuilder outputBuilder = new ProcessFlatBatchOutputBuilder().setBatchFailure(batchFailures); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchMeterAdapters.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchMeterAdapters.java index 33b5691503..584498dcbd 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchMeterAdapters.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/batch/FlatBatchMeterAdapters.java @@ -17,8 +17,6 @@ import com.google.common.util.concurrent.MoreExecutors; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Future; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.ProcessFlatBatchOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.ProcessFlatBatchOutputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.add.meter._case.FlatBatchAddMeter; @@ -130,9 +128,8 @@ public final class FlatBatchMeterAdapters { static Function, RpcResult> convertBatchMeterResult(final int stepOffset) { return new Function, RpcResult>() { - @Nullable @Override - public RpcResult apply(@Nonnull final RpcResult input) { + public RpcResult apply(final RpcResult input) { List batchFailures = wrapBatchMeterFailuresForFlat(input, stepOffset); ProcessFlatBatchOutputBuilder outputBuilder = new ProcessFlatBatchOutputBuilder().setBatchFailure(batchFailures); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerExperimenterMultipartService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerExperimenterMultipartService.java index 29ca98b67b..066efcb70d 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerExperimenterMultipartService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerExperimenterMultipartService.java @@ -15,7 +15,6 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; import org.opendaylight.openflowjava.protocol.api.keys.MessageTypeKey; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; @@ -99,7 +98,7 @@ public class MultiLayerExperimenterMultipartService extends AbstractExperimenter class CallBackImpl implements FutureCallback>> { @Override - public void onSuccess(@Nonnull final RpcResult> result) { + public void onSuccess(final RpcResult> result) { if (result.isSuccessful()) { final List multipartReplies = result.getResult(); if (multipartReplies.isEmpty()) { diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerFlowService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerFlowService.java index ccf0281829..b14d770a94 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerFlowService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerFlowService.java @@ -16,7 +16,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; import org.opendaylight.openflowplugin.api.OFConstants; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; @@ -69,7 +68,7 @@ public final class MultiLayerFlowService extends AbstractS final SettableFuture> finalFuture = SettableFuture.create(); Futures.addCallback(allFutures, new FutureCallback>>() { @Override - public void onSuccess(@Nonnull final List> results) { + public void onSuccess(final List> results) { final ArrayList errors = new ArrayList(); for (RpcResult flowModResult : results) { if (flowModResult == null) { diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerTableMultipartService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerTableMultipartService.java index 5c12ccfcf6..f4bc74b2a6 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerTableMultipartService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/multilayer/MultiLayerTableMultipartService.java @@ -18,7 +18,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Optional; -import javax.annotation.Nonnull; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; import org.opendaylight.openflowplugin.api.openflow.device.Xid; @@ -86,7 +85,7 @@ public class MultiLayerTableMultipartService extends AbstractTableMultipartServi class CallBackImpl implements FutureCallback>> { @Override @SuppressWarnings("checkstyle:IllegalCatch") - public void onSuccess(@Nonnull final RpcResult> result) { + public void onSuccess(final RpcResult> result) { if (result.isSuccessful()) { final List multipartReplies = result.getResult(); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalBundleServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalBundleServiceImpl.java index 531c2905df..232dce1618 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalBundleServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalBundleServiceImpl.java @@ -5,7 +5,6 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.openflowplugin.impl.services.sal; import com.google.common.base.Preconditions; @@ -17,7 +16,6 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.message.service.rev151020.SalExperimenterMessageService; import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.message.service.rev151020.SendExperimenterInputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.message.service.rev151020.SendExperimenterOutput; @@ -91,7 +89,7 @@ public class SalBundleServiceImpl implements SalBundleService { Futures.addCallback(Futures.successfulAsList(partialResults),new FutureCallback< List>>() { @Override - public void onSuccess(@Nonnull List> results) { + public void onSuccess(List> results) { final ArrayList errors = new ArrayList<>(); final RpcResultBuilder rpcResultBuilder; for (RpcResult res : results) { diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlowServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlowServiceImpl.java index c106890052..ff1f3c8ea2 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlowServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalFlowServiceImpl.java @@ -14,7 +14,6 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nonnull; import org.opendaylight.openflowplugin.api.OFConstants; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; @@ -132,7 +131,7 @@ public class SalFlowServiceImpl implements SalFlowService { Futures.addCallback(listListenableFuture, new FutureCallback>>() { @Override - public void onSuccess(@Nonnull final List> results) { + public void onSuccess(final List> results) { final ArrayList errors = new ArrayList(); for (RpcResult flowModResult : results) { if (flowModResult == null) { @@ -200,7 +199,7 @@ public class SalFlowServiceImpl implements SalFlowService { } @Override - public void onSuccess(@Nonnull final RpcResult rpcResult) { + public void onSuccess(final RpcResult rpcResult) { if (rpcResult.isSuccessful()) { final FlowDescriptor flowDescriptor; @@ -238,7 +237,7 @@ public class SalFlowServiceImpl implements SalFlowService { } @Override - public void onSuccess(@Nonnull final RpcResult result) { + public void onSuccess(final RpcResult result) { if (result.isSuccessful()) { if (LOG.isDebugEnabled()) { LOG.debug("Flow remove finished without error for flow={}", input); @@ -268,7 +267,7 @@ public class SalFlowServiceImpl implements SalFlowService { } @Override - public void onSuccess(@Nonnull final RpcResult updateFlowOutputRpcResult) { + public void onSuccess(final RpcResult updateFlowOutputRpcResult) { final DeviceFlowRegistry deviceFlowRegistry = deviceContext.getDeviceFlowRegistry(); final UpdatedFlow updated = input.getUpdatedFlow(); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupServiceImpl.java index 9bf3cd68c1..7c14b0deeb 100755 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalGroupServiceImpl.java @@ -11,7 +11,6 @@ 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 javax.annotation.Nonnull; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; import org.opendaylight.openflowplugin.impl.services.multilayer.MultiLayerGroupService; @@ -74,7 +73,7 @@ public class SalGroupServiceImpl implements SalGroupService { Futures.addCallback(resultFuture, new FutureCallback>() { @Override - public void onSuccess(@Nonnull RpcResult result) { + public void onSuccess(RpcResult result) { if (result.isSuccessful()) { LOG.debug("adding group successful {}", input.getGroupId().getValue()); } else { @@ -105,7 +104,7 @@ public class SalGroupServiceImpl implements SalGroupService { Futures.addCallback(resultFuture, new FutureCallback>() { @Override - public void onSuccess(@Nonnull RpcResult result) { + public void onSuccess(RpcResult result) { if (result.isSuccessful()) { if (LOG.isDebugEnabled()) { LOG.debug("Group update with original id={} finished without error", @@ -136,7 +135,7 @@ public class SalGroupServiceImpl implements SalGroupService { Futures.addCallback(resultFuture, new FutureCallback>() { @Override - public void onSuccess(@Nonnull RpcResult result) { + public void onSuccess(RpcResult result) { if (result.isSuccessful()) { if (LOG.isDebugEnabled()) { LOG.debug("Group remove with id={} finished without error", input.getGroupId().getValue()); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalMeterServiceImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalMeterServiceImpl.java index 2ba1d62f03..9bf7f3d43d 100755 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalMeterServiceImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/sal/SalMeterServiceImpl.java @@ -11,7 +11,6 @@ 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 javax.annotation.Nonnull; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; import org.opendaylight.openflowplugin.impl.services.multilayer.MultiLayerMeterService; @@ -74,7 +73,7 @@ public class SalMeterServiceImpl implements SalMeterService { Futures.addCallback(resultFuture, new FutureCallback>() { @Override - public void onSuccess(@Nonnull RpcResult result) { + public void onSuccess(RpcResult result) { if (result.isSuccessful()) { if (LOG.isDebugEnabled()) { LOG.debug("Meter add with id={} finished without error", input.getMeterId()); @@ -103,9 +102,8 @@ public class SalMeterServiceImpl implements SalMeterService { : updateMeter.handleServiceCall(input.getUpdatedMeter()); Futures.addCallback(resultFuture, new FutureCallback>() { - @Override - public void onSuccess(@Nonnull RpcResult result) { + public void onSuccess(RpcResult result) { if (result.isSuccessful()) { if (LOG.isDebugEnabled()) { LOG.debug("Meter update with id={} finished without error", @@ -136,7 +134,7 @@ public class SalMeterServiceImpl implements SalMeterService { Futures.addCallback(resultFuture, new FutureCallback>() { @Override - public void onSuccess(@Nonnull RpcResult result) { + public void onSuccess(RpcResult result) { if (result.isSuccessful()) { if (LOG.isDebugEnabled()) { LOG.debug("Meter remove with id={} finished without error", input.getMeterId()); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerExperimenterMultipartService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerExperimenterMultipartService.java index aa46070b94..2783b254d3 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerExperimenterMultipartService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerExperimenterMultipartService.java @@ -15,7 +15,6 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; import org.opendaylight.openflowplugin.api.openflow.device.Xid; @@ -61,7 +60,7 @@ public class SingleLayerExperimenterMultipartService extends AbstractExperimente Futures.addCallback(handleServiceCall(input), new FutureCallback>>() { @Override - public void onSuccess(@Nonnull final RpcResult> result) { + public void onSuccess(final RpcResult> result) { if (result.isSuccessful()) { future.set(RpcResultBuilder .success(new SendExperimenterMpRequestOutputBuilder() diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerTableMultipartService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerTableMultipartService.java index a79cf1c837..ddf28f581a 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerTableMultipartService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/services/singlelayer/SingleLayerTableMultipartService.java @@ -16,7 +16,6 @@ import com.google.common.util.concurrent.SettableFuture; import java.math.BigInteger; import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; import org.opendaylight.openflowplugin.api.openflow.device.Xid; @@ -66,7 +65,7 @@ public class SingleLayerTableMultipartService extends AbstractTableMultipartServ Futures.addCallback(handleServiceCall(input), new FutureCallback>>() { @Override @SuppressWarnings("checkstyle:IllegalCatch") - public void onSuccess(@Nonnull final RpcResult> result) { + public void onSuccess(final RpcResult> result) { if (result.isSuccessful()) { final List multipartReplies = result.getResult(); if (multipartReplies.isEmpty()) { diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImpl.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImpl.java index 9c941b39a6..bbd5fbbf7f 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImpl.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsContextImpl.java @@ -23,7 +23,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import org.opendaylight.mdsal.binding.api.TransactionChainClosedException; import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier; import org.opendaylight.openflowplugin.api.ConnectionException; @@ -192,7 +191,7 @@ class StatisticsContextImpl implements StatisticsContext { public void close() { Futures.addCallback(stopGatheringData(), new FutureCallback() { @Override - public void onSuccess(@Nullable final Void result) { + public void onSuccess(final Void result) { requestContexts.forEach(requestContext -> RequestContextUtil .closeRequestContextWithRpcError(requestContext, CONNECTION_CLOSED)); } @@ -228,7 +227,7 @@ class StatisticsContextImpl implements StatisticsContext { // write end timestamp to state snapshot container Futures.addCallback(newDataGathering, new FutureCallback() { @Override - public void onSuccess(@Nonnull final Boolean result) { + public void onSuccess(final Boolean result) { StatisticsGatheringUtils.markDeviceStateSnapshotEnd(deviceInfo, deviceContext, result); } @@ -317,7 +316,7 @@ class StatisticsContextImpl implements StatisticsContext { private final class InitialSubmitCallback implements FutureCallback { @Override - public void onSuccess(@Nullable final Boolean result) { + public void onSuccess(final Boolean result) { contextChainMastershipWatcher .onMasterRoleAcquired(deviceInfo, ContextChainMastershipState.INITIAL_GATHERING); @@ -327,7 +326,7 @@ class StatisticsContextImpl implements StatisticsContext { } @Override - public void onFailure(@Nonnull final Throwable throwable) { + public void onFailure(final Throwable throwable) { contextChainMastershipWatcher.onNotAbleToStartMastershipMandatory(deviceInfo, "Initial gathering statistics " + "unsuccessful: " diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsPollingService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsPollingService.java index 4c8a7f520d..c242c7496a 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsPollingService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/StatisticsPollingService.java @@ -59,12 +59,12 @@ public class StatisticsPollingService extends AbstractScheduledService { Futures.addCallback(gatheringSupplier.get(), new FutureCallback() { @Override - public void onSuccess(@Nonnull final Boolean result) { + public void onSuccess(final Boolean result) { waitFuture.complete(result); } @Override - public void onFailure(@Nonnull final Throwable throwable) { + public void onFailure(final Throwable throwable) { waitFuture.completeExceptionally(throwable); } }, MoreExecutors.directExecutor()); diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/AbstractCompatibleStatService.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/AbstractCompatibleStatService.java index 6e177c8011..fd7fd93e3f 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/AbstractCompatibleStatService.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/statistics/services/compatibility/AbstractCompatibleStatService.java @@ -14,7 +14,6 @@ import com.google.common.util.concurrent.MoreExecutors; import java.math.BigInteger; import java.util.List; import java.util.concurrent.atomic.AtomicLong; -import javax.annotation.Nullable; import org.opendaylight.mdsal.binding.api.NotificationPublishService; import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext; import org.opendaylight.openflowplugin.api.openflow.device.RequestContextStack; @@ -66,7 +65,7 @@ public abstract class AbstractCompatibleStatService>>() { @Override - public void onSuccess(@Nullable RpcResult> result) { + public void onSuccess(RpcResult> result) { if (result != null && result.isSuccessful()) { // transform rpc result (raw multipart) to notification final N flowNotification = transformToNotification(result.getResult(), emulatedTxId); diff --git a/openflowplugin/pom.xml b/openflowplugin/pom.xml index 9cb0ea6d50..2cb5376b3e 100644 --- a/openflowplugin/pom.xml +++ b/openflowplugin/pom.xml @@ -67,16 +67,10 @@ com.google.guava guava - - - junit - junit - test - - org.mockito - mockito-core - test + com.google.code.findbugs + jsr305 + true diff --git a/samples/learning-switch/pom.xml b/samples/learning-switch/pom.xml index a6e3c5b356..d4b2add465 100644 --- a/samples/learning-switch/pom.xml +++ b/samples/learning-switch/pom.xml @@ -26,6 +26,11 @@ javax.annotation-api true + + com.google.code.findbugs + jsr305 + true + org.opendaylight.openflowplugin.model model-flow-base diff --git a/samples/sample-bundles/src/main/java/org/opendaylight/openflowplugin/samples/sample/bundles/SampleFlowCapableNodeListener.java b/samples/sample-bundles/src/main/java/org/opendaylight/openflowplugin/samples/sample/bundles/SampleFlowCapableNodeListener.java index 97c6100af1..b10b7eb51e 100644 --- a/samples/sample-bundles/src/main/java/org/opendaylight/openflowplugin/samples/sample/bundles/SampleFlowCapableNodeListener.java +++ b/samples/sample-bundles/src/main/java/org/opendaylight/openflowplugin/samples/sample/bundles/SampleFlowCapableNodeListener.java @@ -16,7 +16,6 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -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.ModificationType; @@ -126,7 +125,7 @@ public class SampleFlowCapableNodeListener implements ClusteredDataTreeChangeLis } @Override - public void onDataTreeChanged(@Nonnull Collection> modifications) { + public void onDataTreeChanged(Collection> modifications) { for (DataTreeModification modification : modifications) { if (modification.getRootNode().getModificationType() == ModificationType.WRITE) { LOG.info("Node connected: {}", -- 2.36.6