Do not use Iterables when we have a collection
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / InMemoryDataTree.java
index 9d60ed0a9b022f40e53384f60b6a0b9c06f85de5..0f680fddadf30a6cf11410bf7ef2cb31e069c14a 100644 (file)
@@ -7,18 +7,18 @@
  */
 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
 
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import java.util.Collections;
 import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodes;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
-import org.opendaylight.yangtools.yang.data.api.schema.tree.ModificationType;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.slf4j.Logger;
@@ -53,7 +53,6 @@ final class InMemoryDataTree implements DataTree {
     public synchronized void setSchemaContext(final SchemaContext newSchemaContext) {
         Preconditions.checkNotNull(newSchemaContext);
 
-        LOG.info("Attempting to install schema contexts");
         LOG.debug("Following schema contexts will be attempted {}", newSchemaContext);
 
         final SchemaAwareApplyOperation operation = SchemaAwareApplyOperation.from(newSchemaContext);
@@ -85,7 +84,7 @@ final class InMemoryDataTree implements DataTree {
         final InMemoryDataTreeModification m = (InMemoryDataTreeModification)modification;
         final ModifiedNode root = m.getRootModification();
 
-        if (root.getType() == ModificationType.UNMODIFIED) {
+        if (root.getOperation() == LogicalOperation.NONE) {
             return new NoopDataTreeCandidate(PUBLIC_ROOT_PATH, root);
         }
 
@@ -106,7 +105,7 @@ final class InMemoryDataTree implements DataTree {
         final InMemoryDataTreeCandidate c = (InMemoryDataTreeCandidate)candidate;
 
         if (LOG.isTraceEnabled()) {
-            LOG.trace("Data Tree is {}", StoreUtils.toStringTree(c.getAfterRoot().getData()));
+            LOG.trace("Data Tree is {}", NormalizedNodes.toStringTree(c.getAfterRoot().getData()));
         }
 
         final TreeNode newRoot = c.getAfterRoot();
@@ -126,6 +125,6 @@ final class InMemoryDataTree implements DataTree {
 
     @Override
     public String toString() {
-        return Objects.toStringHelper(this).add("object", super.toString()).add("state", state).toString();
+        return MoreObjects.toStringHelper(this).add("object", super.toString()).add("state", state).toString();
     }
 }