Cleanup checkstyle warnings and turn enforcement on in yang-data-impl
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / InMemoryDataTreeFactory.java
index 381184e4dd6a87236378992f5859b8c95b10acc8..a44ae5c98c2e22697266bc02b2af378fd3171a21 100644 (file)
@@ -107,6 +107,18 @@ public final class InMemoryDataTreeFactory implements DataTreeFactory {
             initialSchemaContext, rootSchemaNode, maskMandatory);
     }
 
+    private static DataSchemaNode getRootSchemaNode(final SchemaContext schemaContext,
+            final YangInstanceIdentifier rootPath) {
+        final DataSchemaContextTree contextTree = DataSchemaContextTree.from(schemaContext);
+        final DataSchemaContextNode<?> rootContextNode = contextTree.getChild(rootPath);
+        Preconditions.checkArgument(rootContextNode != null, "Failed to find root %s in schema context", rootPath);
+
+        final DataSchemaNode rootSchemaNode = rootContextNode.getDataSchemaNode();
+        Preconditions.checkArgument(rootSchemaNode instanceof DataNodeContainer,
+            "Root %s resolves to non-container type %s", rootPath, rootSchemaNode);
+        return rootSchemaNode;
+    }
+
     private static NormalizedNode<?, ?> createRoot(final DataNodeContainer schemaNode,
             final YangInstanceIdentifier path) {
         if (path.isEmpty()) {
@@ -132,18 +144,6 @@ public final class InMemoryDataTreeFactory implements DataTreeFactory {
         }
     }
 
-    private static DataSchemaNode getRootSchemaNode(final SchemaContext schemaContext,
-            final YangInstanceIdentifier rootPath) {
-        final DataSchemaContextTree contextTree = DataSchemaContextTree.from(schemaContext);
-        final DataSchemaContextNode<?> rootContextNode = contextTree.getChild(rootPath);
-        Preconditions.checkArgument(rootContextNode != null, "Failed to find root %s in schema context", rootPath);
-
-        final DataSchemaNode rootSchemaNode = rootContextNode.getDataSchemaNode();
-        Preconditions.checkArgument(rootSchemaNode instanceof DataNodeContainer,
-            "Root %s resolves to non-container type %s", rootPath, rootSchemaNode);
-        return rootSchemaNode;
-    }
-
     private static NormalizedNode<?, ?> createRoot(final YangInstanceIdentifier path) {
         if (path.isEmpty()) {
             return ROOT_CONTAINER;