Do not instantiate iterator for debugging 54/46354/2
authorRobert Varga <rovarga@cisco.com>
Fri, 23 Sep 2016 13:38:37 +0000 (15:38 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 3 Oct 2016 12:40:43 +0000 (12:40 +0000)
Logging the entire collection is more appropriate and also
faster when logging is disabled.

Change-Id: Ib3e44851bcedad1eaabad983c1ac45de6890eec2
Signed-off-by: Robert Varga <rovarga@cisco.com>
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisher.java

index 1cfea3463eae969eb465b33f020a501077c374c0..271871677d7fa151f9b0adf8a1527d53a83fb83b 100644 (file)
@@ -212,7 +212,7 @@ abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeC
 
         @Override
         public void onDataTreeChanged(@Nonnull final Collection<DataTreeCandidate> changes) {
-            LOG.debug("Received data changed {}", changes.iterator().next());
+            LOG.debug("Received data changed {}", changes);
             delegate.onDataTreeChanged(changes);
         }
 
@@ -275,8 +275,7 @@ abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeC
         private final PathArgument identifier;
 
         EmptyDataTreeCandidateNode(final PathArgument identifier) {
-            Preconditions.checkNotNull(identifier, "Identifier should not be null");
-            this.identifier = identifier;
+            this.identifier = Preconditions.checkNotNull(identifier, "Identifier should not be null");
         }
 
         @Nonnull
@@ -288,7 +287,7 @@ abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeC
         @Nonnull
         @Override
         public Collection<DataTreeCandidateNode> getChildNodes() {
-            return Collections.<DataTreeCandidateNode>emptySet();
+            return Collections.emptySet();
         }
 
         @Nullable