Remove EffectiveStatementStateAware 18/95518/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 18 Mar 2021 08:13:11 +0000 (09:13 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 18 Mar 2021 08:13:11 +0000 (09:13 +0100)
This interface is not implemented anywhere, remove it.

Change-Id: I37909b06258ab207de1bc5832b6f62571396765c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/InferredStatementContext.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/EffectiveStatementStateAware.java [deleted file]

index 6d69012b990708198ac8036a64834650fb680934..8c2c3db91512708aa24a7e826d16bd12718c1fc1 100644 (file)
@@ -35,7 +35,6 @@ import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
 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;
@@ -225,7 +224,8 @@ final class InferredStatementContext<A, D extends DeclaredStatement<A>, E extend
 
         // 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...
@@ -277,7 +277,8 @@ final class InferredStatementContext<A, D extends DeclaredStatement<A>, E extend
         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) {
@@ -301,17 +302,6 @@ final class InferredStatementContext<A, D extends DeclaredStatement<A>, E extend
         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()));
     }
diff --git a/yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/EffectiveStatementStateAware.java b/yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/EffectiveStatementStateAware.java
deleted file mode 100644 (file)
index c561d8c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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();
-}