Reformulate StatementContextFactory.createEffective()
[yangtools.git] / yang / yang-parser-reactor / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / reactor / StatementContextBase.java
index f2053f767ed1128059bc12ea813f24377c201ddc..6f6119c1ff6b18492a6614f0a226af9c78fd49cc 100644 (file)
@@ -32,6 +32,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Optional;
 import java.util.Set;
+import java.util.stream.Stream;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -561,9 +562,14 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
     }
 
     private E loadEffective() {
-        return effectiveInstance = definition.getFactory().createEffective(this);
+        return effectiveInstance = definition.getFactory().createEffective(new BaseCurrentEffectiveStmtCtx<>(this),
+            streamDeclared(), streamEffective());
     }
 
+    abstract Stream<? extends StmtContext<?, ?, ?>> streamDeclared();
+
+    abstract Stream<? extends StmtContext<?, ?, ?>> streamEffective();
+
     /**
      * Try to execute current {@link ModelProcessingPhase} of source parsing. If the phase has already been executed,
      * this method does nothing.