Migrate mdsal-dom-inmemory-datastore to JDT annotations 51/76751/15
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 8 Oct 2018 12:45:49 +0000 (14:45 +0200)
committerJie Han <han.jie@zte.com.cn>
Tue, 9 Oct 2018 07:57:15 +0000 (07:57 +0000)
This removes the use of javax.annotation nullable annotations
to remove import-package.

Change-Id: I9b05210e5a927e78085779e216fde8cd2142c30b
JIRA: MDSAL-373
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
dom/mdsal-dom-inmemory-datastore/pom.xml
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisher.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShard.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardChangePublisher.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMStoreTreeChangePublisher.java
dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisherTest.java

index 9faf320c89b067b3955dcd8a630e9b85b8b15c09..e74f7b99887d5abf85de099979cb1323db7dde2e 100644 (file)
 
     <build>
         <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>
+                        <!-- Required to suppress immutables.org fallout -->
+                        <Import-Package>!javax.annotation,*</Import-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-checkstyle-plugin</artifactId>
index 644e7d368c461918b7ea3a43d8ddbb616ea8a033..8b5e55a9f230b49e76981b183528a62c3c7775c9 100644 (file)
@@ -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<DataTreeCandidate> changes) {
+        public void onDataTreeChanged(final Collection<DataTreeCandidate> changes) {
             LOG.debug("Received data changed {}", changes);
             delegate.onDataTreeChanged(changes);
         }
index a2c6957f62f50f8446c30bd086cf32fefa1cbf81..06fc441df5111d0461d33947e348cd52e40fb82a 100644 (file)
@@ -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 <L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerTreeChangeListener(
-            @Nonnull final YangInstanceIdentifier treeId, @Nonnull final L listener) {
+            final YangInstanceIdentifier treeId, final L listener) {
         return shardChangePublisher.registerTreeChangeListener(treeId, listener);
     }
 
index 224a3d802d52d0725e3eaa55ca1e245528fde37d..c2a4c1feaf8ae913f1fbe7b4396004085384aacc 100644 (file)
@@ -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<DOMDataTreeIdentifier, ChildShardContext> 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<DataTreeCandidate> changes) {
+    protected void notifyListener(final AbstractDOMDataTreeChangeListenerRegistration<?> registration,
+            final Collection<DataTreeCandidate> 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);
     }
 }
index c92f40b4ae16923d5b041c43a03700bf6c234dac..81cc57d0cf0b32c94fd07e6124ca5f555375cf61 100644 (file)
@@ -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);
     }
index d41e7b993f37b2410a8c8615d811b1186592c889..4b4547836f97cae3f450b45deac8305f1aa80f70 100644 (file)
@@ -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
     }