import com.google.common.collect.ImmutableSet;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import java.util.Objects;
import java.util.Optional;
import org.opendaylight.yangtools.yang.common.Empty;
@Override
public void apply(final InferenceContext ctx) {
+ if (!augmentNode.isSupportedToBuildEffective()) {
+ // We are not building effective model, hence we should not be performing any effects
+ return;
+ }
+
final StatementContextBase<?, ?, ?> augmentTargetCtx = (StatementContextBase<?, ?, ?>) target.resolve(ctx);
if (!isSupportedAugmentTarget(augmentTargetCtx)
|| StmtContextUtils.isInExtensionBody(augmentTargetCtx)) {
throw new InferenceException(augmentNode, "Augment target '%s' not found", augmentNode.argument());
}
+ @Override
+ public void prerequisiteUnavailable(final Prerequisite<?> unavail) {
+ if (target.equals(unavail)) {
+ augmentNode.setIsSupportedToBuildEffective(false);
+ } else {
+ prerequisiteFailed(List.of(unavail));
+ }
+ }
+
private void copyFromSourceToTarget(final StatementContextBase<?, ?, ?> sourceCtx,
final StatementContextBase<?, ?, ?> targetCtx) {
final CopyType typeOfCopy = sourceCtx.coerceParentContext().producesDeclared(UsesStatement.class)