import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeEffectiveStatement;
import org.opendaylight.yangtools.yang.parser.spi.SchemaTreeNamespace;
import org.opendaylight.yangtools.yang.parser.spi.meta.CopyType;
-import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStatementStateAware;
import org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException;
import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.OnDemandSchemaTreeStorageNode;
import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.StorageNodeType;
// First check if we can reuse the entire prototype
if (!factory.canReuseCurrent(this, prototype, origSubstatements)) {
- return deduplicate(tryToReuseSubstatements(factory, origEffective));
+ // FIXME: YANGTOOLS-1214: deduplicate this return
+ return tryToReuseSubstatements(factory, origEffective);
}
// We can reuse this statement let's see if all statements agree...
prototype.decRef();
// Values are the effective copies, hence this efficiently deals with recursion.
- return deduplicate(factory.createEffective(this, declared.stream(), effective.stream()));
+ // FIXME: YANGTOOLS-1214: deduplicate this return
+ return factory.createEffective(this, declared.stream(), effective.stream());
}
private @NonNull E tryToReuseSubstatements(final StatementFactory<A, D, E> factory, final @NonNull E original) {
return effective;
}
- private @NonNull E deduplicate(final @NonNull E effective) {
- if (effective instanceof EffectiveStatementStateAware) {
- final ReactorStmtCtx<A, D, E> source = unmodifiedEffectiveSource();
- if (source != this) {
- return source.attachCopy(((EffectiveStatementStateAware) effective).toEffectiveStatementState(),
- effective);
- }
- }
- return effective;
- }
-
private List<ReactorStmtCtx<?, ?, ?>> reusePrototypeReplicas() {
return reusePrototypeReplicas(Streams.concat(prototype.streamDeclared(), prototype.streamEffective()));
}
+++ /dev/null
-/*
- * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.yangtools.yang.parser.spi.meta;
-
-import com.google.common.annotations.Beta;
-import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-
-/**
- * Optional extension to {@link EffectiveStatement} exposing {@link EffectiveStatementState} to the reactor.
- */
-@Beta
-@NonNullByDefault
-public interface EffectiveStatementStateAware {
- /**
- * Return the {@link EffectiveStatementState} corresponding to this statement.
- *
- * @return EffectiveStatementState
- */
- EffectiveStatementState toEffectiveStatementState();
-}