From: Robert Varga Date: Mon, 8 Oct 2018 12:45:49 +0000 (+0200) Subject: Migrate mdsal-dom-inmemory-datastore to JDT annotations X-Git-Tag: v3.0.1~52 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=1e12c3d39bb96edf7166cd3040b18bf4d5bafabf;p=mdsal.git Migrate mdsal-dom-inmemory-datastore to JDT annotations This removes the use of javax.annotation nullable annotations to remove import-package. Change-Id: I9b05210e5a927e78085779e216fde8cd2142c30b JIRA: MDSAL-373 Signed-off-by: Robert Varga --- diff --git a/dom/mdsal-dom-inmemory-datastore/pom.xml b/dom/mdsal-dom-inmemory-datastore/pom.xml index 9faf320c89..e74f7b9988 100644 --- a/dom/mdsal-dom-inmemory-datastore/pom.xml +++ b/dom/mdsal-dom-inmemory-datastore/pom.xml @@ -108,6 +108,16 @@ + + org.apache.felix + maven-bundle-plugin + + + + !javax.annotation,* + + + org.apache.maven.plugins maven-checkstyle-plugin diff --git a/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisher.java b/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisher.java index 644e7d368c..8b5e55a9f2 100644 --- a/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisher.java +++ b/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisher.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.mdsal.dom.store.inmemory; import com.google.common.base.Preconditions; @@ -18,7 +17,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; -import javax.annotation.Nonnull; import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier; import org.opendaylight.mdsal.dom.spi.AbstractDOMDataTreeChangeListenerRegistration; @@ -212,7 +210,7 @@ abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeC } @Override - public void onDataTreeChanged(@Nonnull final Collection changes) { + public void onDataTreeChanged(final Collection changes) { LOG.debug("Received data changed {}", changes); delegate.onDataTreeChanged(changes); } diff --git a/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShard.java b/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShard.java index a2c6957f62..06fc441df5 100644 --- a/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShard.java +++ b/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShard.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.mdsal.dom.store.inmemory; import com.google.common.annotations.Beta; @@ -22,7 +21,6 @@ import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.Executor; -import javax.annotation.Nonnull; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier; @@ -181,10 +179,9 @@ public class InMemoryDOMDataTreeShard implements ReadableWriteableDOMDataTreeSha } } - @Nonnull @Override public ListenerRegistration registerTreeChangeListener( - @Nonnull final YangInstanceIdentifier treeId, @Nonnull final L listener) { + final YangInstanceIdentifier treeId, final L listener) { return shardChangePublisher.registerTreeChangeListener(treeId, listener); } diff --git a/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardChangePublisher.java b/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardChangePublisher.java index 224a3d802d..c2a4c1feaf 100644 --- a/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardChangePublisher.java +++ b/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardChangePublisher.java @@ -5,14 +5,12 @@ * 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.mdsal.dom.store.inmemory; import com.google.common.collect.ImmutableList; import java.util.Collection; import java.util.Map; import java.util.concurrent.Executor; -import javax.annotation.Nonnull; import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier; import org.opendaylight.mdsal.dom.spi.AbstractDOMDataTreeChangeListenerRegistration; @@ -46,24 +44,24 @@ final class InMemoryDOMDataTreeShardChangePublisher extends AbstractDOMShardTree final YangInstanceIdentifier rootPath, final Map childShards) { super(dataTree, rootPath, childShards); - notificationManager = QueuedNotificationManager.create( - executor, MANAGER_INVOKER, maxQueueSize, "DataTreeChangeListenerQueueMgr"); + notificationManager = QueuedNotificationManager.create(executor, MANAGER_INVOKER, maxQueueSize, + "DataTreeChangeListenerQueueMgr"); } @Override - protected void notifyListener(AbstractDOMDataTreeChangeListenerRegistration registration, - Collection changes) { + protected void notifyListener(final AbstractDOMDataTreeChangeListenerRegistration registration, + final Collection changes) { LOG.debug("Enqueueing candidates {} for registration {}", changes, registration); notificationManager.submitNotifications(registration, changes); } @Override - protected void registrationRemoved(@Nonnull final AbstractDOMDataTreeChangeListenerRegistration registration) { + protected void registrationRemoved(final AbstractDOMDataTreeChangeListenerRegistration registration) { LOG.debug("Closing registration {}", registration); } - synchronized void publishChange(@Nonnull final DataTreeCandidate candidate) { + synchronized void publishChange(final DataTreeCandidate candidate) { processCandidateTree(candidate); } } diff --git a/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMStoreTreeChangePublisher.java b/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMStoreTreeChangePublisher.java index c92f40b4ae..81cc57d0cf 100644 --- a/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMStoreTreeChangePublisher.java +++ b/dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMStoreTreeChangePublisher.java @@ -11,7 +11,7 @@ import com.google.common.collect.ImmutableList; import java.util.Collection; import java.util.Optional; import java.util.concurrent.ExecutorService; -import javax.annotation.Nonnull; +import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; import org.opendaylight.mdsal.dom.spi.AbstractDOMDataTreeChangeListenerRegistration; import org.opendaylight.mdsal.dom.spi.store.AbstractDOMStoreTreeChangePublisher; @@ -86,7 +86,7 @@ final class InMemoryDOMStoreTreeChangePublisher extends AbstractDOMStoreTreeChan return reg; } - synchronized void publishChange(@Nonnull final DataTreeCandidate candidate) { + synchronized void publishChange(final @NonNull DataTreeCandidate candidate) { // Runs synchronized with registrationRemoved() processCandidateTree(candidate); } diff --git a/dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisherTest.java b/dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisherTest.java index d41e7b993f..4b4547836f 100644 --- a/dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisherTest.java +++ b/dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisherTest.java @@ -22,7 +22,6 @@ import com.google.common.collect.ImmutableMap; import java.util.Collection; import java.util.Map; import java.util.Optional; -import javax.annotation.Nonnull; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -135,7 +134,7 @@ public class AbstractDOMShardTreeChangePublisherTest extends AbstractDOMShardTre } @Override - protected void registrationRemoved(@Nonnull final AbstractDOMDataTreeChangeListenerRegistration registration) { + protected void registrationRemoved(final AbstractDOMDataTreeChangeListenerRegistration registration) { // NOOP }