Eliminate no-op MandatoryLeafEnforcer
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / SchemaAwareApplyOperation.java
index 96f4837fc0946f709b01c1bdc869db1bdc13481f..936877add392304755b7c5f8fc2faf901fe86256 100644 (file)
@@ -45,10 +45,7 @@ abstract class SchemaAwareApplyOperation extends ModificationApplyOperation {
                 schemaNode.getPath());
         }
         if (schemaNode instanceof ContainerSchemaNode) {
-            final ContainerSchemaNode containerSchema = (ContainerSchemaNode) schemaNode;
-            return containerSchema.isPresenceContainer()
-                    ? new PresenceContainerModificationStrategy(containerSchema, treeConfig)
-                            : new StructuralContainerModificationStrategy(containerSchema, treeConfig);
+            return ContainerModificationStrategy.of((ContainerSchemaNode) schemaNode, treeConfig);
         } else if (schemaNode instanceof ListSchemaNode) {
             return fromListSchemaNode((ListSchemaNode) schemaNode, treeConfig);
         } else if (schemaNode instanceof ChoiceSchemaNode) {