+ private boolean substatementsContextIndependent() {
+ // FIXME: YANGTOOLS-1195: we really want to compute (and cache) the summary for substatements.
+ //
+ // For now we just check if there are any substatements, but we really want to ask:
+ //
+ // Are all substatements (recursively) CONTEXT_INDEPENDENT as well?
+ //
+ // Which is something we want to compute once and store. This needs to be implemented.
+ return hasEmptySubstatements();
+ }
+
+ // FIXME: YANGTOOLS-1195: this method is unused, but should be called from InferredStatementContext at the very
+ // least. It should return @NonNull -- either 'E' or EffectiveStmtCtx.Current'. Perhaps its arguments need
+ // to be adjusted, too.
+ final void asEffectiveChildOf(final Mutable<?, ?, ?> parent, final CopyType type, final QNameModule targetModule) {
+ checkEffectiveModelCompleted(this);
+
+ final StatementSupport<A, D, E> support = definition.support();
+ final StmtContext<?, ?, ?> effective = support.effectiveCopyOf(this, parent, type, targetModule);
+ if (effective == this) {
+ LOG.debug("Should reuse {}", this);
+ return;
+ }
+
+ // FIXME: YANGTOOLS-1195: here is probably where we want to do some statement reuse: even if the parent is
+ // affected, some substatements may not -- in which case we want to reuse them. This
+ // probably needs to be a callout of some kind.
+ // FIXME: YANGTOOLS-1067: an incremental improvement to that is that if no substatements changed, we want to
+ // be reusing the entire List<EffectiveStatement> and pass that as substatements.
+ }
+