Inline AugmentInferenceAction.needToCopyByAugment()
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / augment / AugmentInferenceAction.java
index 520b619566e81f9a43490b19fc40a3b7c11c7cae..f00172ffbc0b550aca1114024307426e8c9a92ef 100644 (file)
@@ -138,7 +138,7 @@ final class AugmentInferenceAction implements InferenceAction {
             final boolean skipCheckOfMandatoryNodes, final boolean unsupported) {
         // We always copy statements, but if either the source statement or the augmentation which causes it are not
         // supported to build we also mark the target as such.
-        if (needToCopyByAugment(original)) {
+        if (!NOCOPY_DEF_SET.contains(original.publicDefinition())) {
             validateNodeCanBeCopiedByAugment(original, target, typeOfCopy, skipCheckOfMandatoryNodes);
 
             final Mutable<?, ?, ?> copy = target.childCopyOf(original, typeOfCopy);
@@ -259,10 +259,6 @@ final class AugmentInferenceAction implements InferenceAction {
         return parent;
     }
 
-    private static boolean needToCopyByAugment(final StmtContext<?, ?, ?> stmtContext) {
-        return !NOCOPY_DEF_SET.contains(stmtContext.publicDefinition());
-    }
-
     private static boolean isSupportedAugmentTarget(final StmtContext<?, ?, ?> substatementCtx) {
         /*
          * :TODO Substatement must be allowed augment target type e.g.