Do not instantiate iterator for debugging 31/46131/2
authorRobert Varga <rovarga@cisco.com>
Fri, 23 Sep 2016 13:38:37 +0000 (15:38 +0200)
committerTom Pantelis <tpanteli@brocade.com>
Mon, 3 Oct 2016 16:15:19 +0000 (16:15 +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 b310329f8bc46a4fc271404bae1e622f5c316b41..250494180c62bdcae2807ebc97956a11581714ef 100644 (file)
@@ -213,7 +213,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);
         }
 
@@ -276,8 +276,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
@@ -289,7 +288,7 @@ abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeC
         @Nonnull
         @Override
         public Collection<DataTreeCandidateNode> getChildNodes() {
-            return Collections.<DataTreeCandidateNode>emptySet();
+            return Collections.emptySet();
         }
 
         @Nullable