Cleanup yang-data-impl nullness annotations
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / InMemoryDataTreeSnapshotCursor.java
index ed5eaf27c2e8701065c5edd6ca3577d9a12759ac..0aae3f749740468ddda02b6e9c34e26fbf6da59c 100644 (file)
@@ -7,11 +7,12 @@
  */
 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
 
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkState;
+
 import java.util.ArrayDeque;
 import java.util.Deque;
-import javax.annotation.Nonnull;
+import java.util.Optional;
 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.NormalizedNode;
@@ -28,23 +29,23 @@ final class InMemoryDataTreeSnapshotCursor extends AbstractCursor<InMemoryDataTr
     }
 
     @Override
-    public void enter(@Nonnull final PathArgument child) {
+    public void enter(final PathArgument child) {
         final Optional<NormalizedNode<?, ?>> maybeChildNode = NormalizedNodes.getDirectChild(stack.peek(), child);
-        Preconditions.checkArgument(maybeChildNode.isPresent(), "Child %s not found", child);
+        checkArgument(maybeChildNode.isPresent(), "Child %s not found", child);
 
         final NormalizedNode<?, ?> childNode = maybeChildNode.get();
-        Preconditions.checkArgument(childNode instanceof NormalizedNodeContainer, "Child %s is not a container", child);
+        checkArgument(childNode instanceof NormalizedNodeContainer, "Child %s is not a container", child);
         stack.push((NormalizedNodeContainer<?, ?, ?>) childNode);
     }
 
     @Override
     @SuppressWarnings("checkstyle:illegalCatch")
-    public void enter(@Nonnull final Iterable<PathArgument> path) {
+    public void enter(final Iterable<PathArgument> path) {
         final Optional<NormalizedNode<?, ?>> maybeChildNode = NormalizedNodes.findNode(stack.peek(), path);
-        Preconditions.checkArgument(maybeChildNode.isPresent(), "Child %s not found", path);
+        checkArgument(maybeChildNode.isPresent(), "Child %s not found", path);
 
         final NormalizedNode<?, ?> childNode = maybeChildNode.get();
-        Preconditions.checkArgument(childNode instanceof NormalizedNodeContainer, "Child %s is not a container", path);
+        checkArgument(childNode instanceof NormalizedNodeContainer, "Child %s is not a container", path);
 
         int depth = 0;
         for (PathArgument arg : path) {
@@ -63,8 +64,8 @@ final class InMemoryDataTreeSnapshotCursor extends AbstractCursor<InMemoryDataTr
 
     @Override
     public void exit(final int depth) {
-        Preconditions.checkArgument(depth >= 0);
-        Preconditions.checkState(depth < stack.size());
+        checkArgument(depth >= 0);
+        checkState(depth < stack.size());
 
         for (int i = 0; i < depth; ++i) {
             stack.pop();
@@ -72,7 +73,7 @@ final class InMemoryDataTreeSnapshotCursor extends AbstractCursor<InMemoryDataTr
     }
 
     @Override
-    public Optional<NormalizedNode<?, ?>> readNode(@Nonnull final PathArgument child) {
+    public Optional<NormalizedNode<?, ?>> readNode(final PathArgument child) {
         return NormalizedNodes.findNode(stack.peek(), child);
     }
 }