import com.google.common.base.VerifyException;
import java.util.Collection;
-import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
*/
private static final int REFCOUNT_SWEPT = Integer.MIN_VALUE;
+ @Override
+ public abstract StatementContextBase<?, ?, ?> getParentContext();
+
/**
* Acquire a reference on this context. As long as there is at least one reference outstanding,
* {@link #buildEffective()} will not result in {@link #effectiveSubstatements()} being discarded.
abstract boolean noImplictRef();
- abstract @Nullable ReactorStmtCtx<?, ?, ?> parentStmtCtx();
-
// Called when this statement does not have an implicit reference and have reached REFCOUNT_NONE
private void sweepOnDecrement() {
LOG.trace("Sweeping on decrement {}", this);
}
// Propagate towards parent if there is one
- final ReactorStmtCtx<?, ?, ?> parent = parentStmtCtx();
+ final ReactorStmtCtx<?, ?, ?> parent = getParentContext();
if (parent != null) {
parent.sweepOnChildDecrement();
}
if (noParentRefcount()) {
LOG.trace("Cleanup {} of parent {}", refcount, this);
if (sweepState()) {
- final ReactorStmtCtx<?, ?, ?> parent = parentStmtCtx();
+ final ReactorStmtCtx<?, ?, ?> parent = getParentContext();
if (parent != null) {
parent.sweepOnChildDecrement();
}
// FIXME: cache the resolution of this
private boolean noParentRefcount() {
- final ReactorStmtCtx<?, ?, ?> parent = parentStmtCtx();
+ final ReactorStmtCtx<?, ?, ?> parent = getParentContext();
if (parent != null) {
// There are three possibilities:
// - REFCOUNT_NONE, in which case we need to search next parent
LOG.trace("Child refcount {}", refcount);
if (refcount == REFCOUNT_NONE) {
sweepDone();
- final ReactorStmtCtx<?, ?, ?> parent = parentStmtCtx();
+ final ReactorStmtCtx<?, ?, ?> parent = getParentContext();
LOG.trace("Propagating to parent {}", parent);
if (parent != null && parent.isAwaitingChildren()) {
parent.sweepOnChildDone();