Inline AugmentInferenceAction.needToCopyByAugment() 13/94113/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Dec 2020 14:25:17 +0000 (15:25 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 8 Dec 2020 15:02:52 +0000 (16:02 +0100)
There is a single caller of this simplistic method, just inline it
for clarity.

Change-Id: I2dddf1a6eaa22f8a7c1bf73888734fc2a3eafa37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
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.