Revert "Revert "Updated SchemaNodeIdentifier namespace handling.""
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / reactor / SubstatementContext.java
index 4c3be3e9a2e16ad4fb2696d60a8ba9f67d6af180..04a01d17fceaebb6b1b913c071519724ea8cb489 100644 (file)
@@ -63,10 +63,6 @@ class SubstatementContext<A, D extends DeclaredStatement<A>, E extends Effective
         } else {
             this.argument = original.argument;
         }
-
-        copyDeclaredStmts(original, newQNameModule, typeOfCopy);
-
-        copyEffectiveStmts(original, newQNameModule, typeOfCopy);
     }
 
     private void copyDeclaredStmts(SubstatementContext<A, D, E> original,
@@ -150,6 +146,9 @@ class SubstatementContext<A, D extends DeclaredStatement<A>, E extends Effective
         }
 
         definition().onStatementAdded(copy);
+
+        copy.copyDeclaredStmts(this, newQNameModule, typeOfCopy);
+        copy.copyEffectiveStmts(this, newQNameModule, typeOfCopy);
         return copy;
     }