Move common code 17/87117/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 23 Jan 2020 16:36:18 +0000 (17:36 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 23 Jan 2020 20:47:02 +0000 (21:47 +0100)
We have a single line which is duplicated, move it to common code.

Change-Id: I738168386ea0efb7c7bab11e23aa219e076b564b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/StatementContextBase.java

index 08ab75f794bf91d83fdf7482f6b173ff4e5cc375..8cc6b37712003e0d993b735986bf3676031fe319 100644 (file)
@@ -809,12 +809,11 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
 
             copy = new SubstatementContext<>(original, result, childCopyType, targetModule);
             result.addEffectiveSubstatement(copy);
-            original.definition().onStatementAdded(copy);
         } else {
             result = copy = new SubstatementContext<>(original, this, type, targetModule);
-            original.definition().onStatementAdded(copy);
         }
 
+        original.definition().onStatementAdded(copy);
         original.copyTo(copy, type, targetModule);
         return result;
     }