Simplify check for tree/node match
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / SchemaAwareApplyOperation.java
index b119a64664a130f17bfe660687b183894146780b..f07844c43515a2e2ac29b599757070b2747931f5 100644 (file)
@@ -261,16 +261,14 @@ abstract class SchemaAwareApplyOperation extends ModificationApplyOperation {
             final Optional<TreeNode> current) throws DataValidationFailedException;
 
     /**
-     * Checks if supplied schema node belong to specified Data Tree type.
+     * Checks if supplied schema node belong to specified Data Tree type. All nodes belong to the operational tree,
+     * nodes in configuration tree are marked as such.
      *
      * @param treeType Tree Type
      * @param node Schema node
      * @return
      */
     static boolean belongsToTree(final TreeType treeType, final DataSchemaNode node) {
-        if(treeType == TreeType.CONFIGURATION) {
-            return node.isConfiguration();
-        }
-        return true;
+        return treeType == TreeType.OPERATIONAL || node.isConfiguration();
     }
 }