Revert "Add SchemaTreeAwareEffectiveStatement" 61/74661/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 30 Jul 2018 17:00:03 +0000 (19:00 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 30 Jul 2018 17:00:33 +0000 (19:00 +0200)
This reverts commit eae57f9cd4605c5b13a24d843c0e4278d8b5deb2.

Change-Id: If651cc6d925c1f9ea616a75ffd426a49666b5ee1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
22 files changed:
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/meta/EffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/ActionEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/AnydataEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/AnyxmlEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/CaseEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/ChoiceEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/ContainerEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/InputEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/LeafEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/LeafListEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/ListEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/ModuleEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/NotificationEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/OutputEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/RpcEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaTreeAwareEffectiveStatement.java [deleted file]
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaTreeEffectiveStatement.java [deleted file]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractEffectiveDocumentedDataNodeContainer.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractEffectiveModule.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractEffectiveSchemaNode.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractSchemaEffectiveDocumentedNode.java [deleted file]
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/UnknownEffectiveStatementBase.java

index cb50dc9ca60302404b97d3b7caf666c3b57000c5..4d0a7f9f5d3283ca4d3d0619d7e982d6ac11be1d 100644 (file)
@@ -22,10 +22,13 @@ import org.eclipse.jdt.annotation.NonNull;
 /**
  * Effective model statement which should be used to derive application behaviour.
  *
- * @param <A> Argument type ({@link Void} if statement does not have argument.)
- * @param <D> Class representing declared version of this statement.
+ * @param <A>
+ *            Argument type ({@link Void} if statement does not have argument.)
+ * @param <S>
+ *            Class representing declared version of this statement.
  */
-public interface EffectiveStatement<A, D extends DeclaredStatement<A>> extends ModelStatement<A> {
+public interface EffectiveStatement<A, S extends DeclaredStatement<A>> extends ModelStatement<A> {
+
     /**
      * Returns statement, which was explicit declaration of this effective
      * statement.
@@ -34,7 +37,7 @@ public interface EffectiveStatement<A, D extends DeclaredStatement<A>> extends M
      *         statement or null if statement was inferred from context.
      */
     @Nullable
-    D getDeclared();
+    S getDeclared();
 
     /**
      * Returns value associated with supplied identifier.
index d3dc0725ab5262b9a24a983688370f9b6f2fb3b0..f45ead8dbccc18f8d9d80caf4a50ac01a601db2d 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 @Beta
-public interface ActionEffectiveStatement extends SchemaTreeEffectiveStatement<ActionStatement>,
-    SchemaTreeAwareEffectiveStatement<QName, ActionStatement> {
+public interface ActionEffectiveStatement extends EffectiveStatement<QName, ActionStatement> {
 
 }
index 798d2ab18765e66ff700a8220c446997238bcc8f..b4265a2caeb64b8a5d8a85504f6a0d9b155ca54d 100644 (file)
@@ -8,8 +8,10 @@
 package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 @Beta
-public interface AnydataEffectiveStatement extends SchemaTreeEffectiveStatement<AnydataStatement> {
+public interface AnydataEffectiveStatement extends EffectiveStatement<QName, AnydataStatement> {
 
 }
index 20756ba96f994089c6071088bca5539b4a053f65..cd6a50a5b398e6259ffe7a5a7bf3711277c37ced 100644 (file)
@@ -8,8 +8,10 @@
 package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 @Beta
-public interface AnyxmlEffectiveStatement extends SchemaTreeEffectiveStatement<AnyxmlStatement> {
+public interface AnyxmlEffectiveStatement extends EffectiveStatement<QName, AnyxmlStatement> {
 
 }
index 1f9a675d3e26db5955e951b4a75dd2c8fe75c11c..60d25b3fc6d7d38725e03c8760cf03e36d547c1a 100644 (file)
@@ -8,10 +8,8 @@
 package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
-import org.opendaylight.yangtools.yang.common.QName;
 
 @Beta
-public interface CaseEffectiveStatement extends SchemaTreeEffectiveStatement<CaseStatement>,
-    SchemaTreeAwareEffectiveStatement<QName, CaseStatement> {
+public interface CaseEffectiveStatement extends NamespacedEffectiveStatement<CaseStatement> {
 
 }
index 6c555623fcdd892125bdfecc8dc411965ddf7110..08d9346778219b479bf0ade5c1de20cf64557280 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 @Beta
-public interface ChoiceEffectiveStatement extends SchemaTreeEffectiveStatement<ChoiceStatement>,
-    SchemaTreeAwareEffectiveStatement<QName, ChoiceStatement> {
+public interface ChoiceEffectiveStatement extends EffectiveStatement<QName, ChoiceStatement> {
 
 }
index f1b2481f7b1ed1306f0343f5134864c496914162..1dba8165fb57413d2d9ef41554fc97cf139e38f1 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 @Beta
-public interface ContainerEffectiveStatement extends SchemaTreeEffectiveStatement<ContainerStatement>,
-     SchemaTreeAwareEffectiveStatement<QName, ContainerStatement> {
+public interface ContainerEffectiveStatement extends EffectiveStatement<QName, ContainerStatement> {
 
 }
index b131e6b6aafa59b21962ae13c9d55a98331d00b6..dd28bcaab804c920d4f707be2a3f1e0144703da7 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 @Beta
-public interface InputEffectiveStatement extends SchemaTreeEffectiveStatement<InputStatement>,
-    SchemaTreeAwareEffectiveStatement<QName, InputStatement> {
+public interface InputEffectiveStatement extends EffectiveStatement<QName, InputStatement> {
 
 }
index dc97dd200fbbbf51352a6dbd1f3bc951130b8483..313988b577249bfc005167a3f4f6990df50f7f42 100644 (file)
@@ -8,8 +8,10 @@
 package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 @Beta
-public interface LeafEffectiveStatement extends SchemaTreeEffectiveStatement<LeafStatement> {
+public interface LeafEffectiveStatement extends EffectiveStatement<QName, LeafStatement> {
 
 }
index f113b28ae5d19c605d3f0a88f03ccecca949f58a..de168a14523c01cce551178989efce11e3c663c8 100644 (file)
@@ -8,8 +8,10 @@
 package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 @Beta
-public interface LeafListEffectiveStatement extends SchemaTreeEffectiveStatement<LeafListStatement> {
+public interface LeafListEffectiveStatement extends EffectiveStatement<QName, LeafListStatement> {
 
 }
index 0ebad88b5819c3c3972ea7a5a123f3157ac554e8..30aa63666c60370a3de3a0a0c566e0b6e12172a2 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 @Beta
-public interface ListEffectiveStatement extends SchemaTreeEffectiveStatement<ListStatement>,
-    SchemaTreeAwareEffectiveStatement<QName, ListStatement> {
+public interface ListEffectiveStatement extends EffectiveStatement<QName, ListStatement> {
 
 }
index a77960d982352a9e849f2a5dbb791ef2d37bc736..7eea1e0264555f3f7eb187052520f2723a23ce7b 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.yangtools.yang.model.api.stmt;
 import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.QNameModule;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 
 /**
@@ -20,7 +21,7 @@ import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 //               an ordinary String. We really want this to be a QName, so that we do not need the localQNameModule
 //               bit, but that may be problematic with ModuleStatement, which is getting created before we even know
 //               the namespace :( A type capture of the string may just be sufficient.
-public interface ModuleEffectiveStatement extends SchemaTreeAwareEffectiveStatement<String, ModuleStatement> {
+public interface ModuleEffectiveStatement extends EffectiveStatement<String, ModuleStatement> {
     /**
      * Namespace mapping all known prefixes in a module to their modules. Note this namespace includes the module
      * in which it is instantiated.
index 2479d01ca99ab3245d7970f89c8abbcefd2159fc..7c32365fe459f19f486e55cec52d288a4c08e8ab 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 @Beta
-public interface NotificationEffectiveStatement extends SchemaTreeEffectiveStatement<NotificationStatement>,
-    SchemaTreeAwareEffectiveStatement<QName, NotificationStatement> {
+public interface NotificationEffectiveStatement extends EffectiveStatement<QName, NotificationStatement> {
 
 }
index c7fe425ced2b64300cb35faca239573484a95210..79bca054813e5fa2cb72b6784c1bebb3a90f4686 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 @Beta
-public interface OutputEffectiveStatement extends SchemaTreeEffectiveStatement<OutputStatement>,
-    SchemaTreeAwareEffectiveStatement<QName, OutputStatement> {
+public interface OutputEffectiveStatement extends EffectiveStatement<QName, OutputStatement> {
 
 }
index 6612cd5bd69fc167990934f3bdf739abfd577e0c..61af9e36f83805e4dd6c919790692317b3e09908 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.yangtools.yang.model.api.stmt;
 
 import com.google.common.annotations.Beta;
 import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
 @Beta
-public interface RpcEffectiveStatement extends SchemaTreeEffectiveStatement<RpcStatement>,
-    SchemaTreeAwareEffectiveStatement<QName, RpcStatement> {
+public interface RpcEffectiveStatement extends EffectiveStatement<QName, RpcStatement> {
 
 }
diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaTreeAwareEffectiveStatement.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaTreeAwareEffectiveStatement.java
deleted file mode 100644 (file)
index 89ba9d8..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2018 Pantheon Technologies, 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.model.api.stmt;
-
-import static java.util.Objects.requireNonNull;
-
-import com.google.common.annotations.Beta;
-import java.util.Optional;
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-
-/**
- * Interface implemented by all {@link EffectiveStatement}s which can contain a {@code schema tree} child. This tree
- * can be walked using {@link SchemaNodeIdentifier}, looking up each component of
- * {@link SchemaNodeIdentifier#getPathFromRoot()} using {@link #findSchemaTreeNode(QName)}.
- *
- * @param <A> Argument type
- * @param <D> Class representing declared version of this statement.
- * @author Robert Varga
- */
-@Beta
-public interface SchemaTreeAwareEffectiveStatement<A, D extends DeclaredStatement<A>> extends EffectiveStatement<A, D> {
-    /**
-     * Namespace of {@code schema node}s defined within this node.
-     *
-     * @param <T> Child statement type
-     * @author Robert Varga
-     */
-    @NonNullByDefault
-    abstract class Namespace<T extends SchemaTreeEffectiveStatement<?>> extends EffectiveStatementNamespace<T> {
-        private Namespace() {
-            // Should never be instantiated
-        }
-    }
-
-    /**
-     * Find a {@code schema tree} child {@link SchemaTreeEffectiveStatement}, as identified by its QName argument.
-     *
-     * @param qname Child identifier
-     * @return Schema tree child, or empty
-     * @throws NullPointerException if {@code qname} is null
-     */
-    // FIXME: make sure this namespace is populated
-    default <E extends SchemaTreeEffectiveStatement<?>> @NonNull Optional<E> findSchemaTreeNode(
-            final @NonNull QName qname) {
-        return Optional.ofNullable(get(Namespace.class, requireNonNull(qname)));
-    }
-}
diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaTreeEffectiveStatement.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaTreeEffectiveStatement.java
deleted file mode 100644 (file)
index 9468c2b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2018 Pantheon Technologies, 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.model.api.stmt;
-
-import com.google.common.annotations.Beta;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.SchemaNode;
-import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-
-/**
- * Common interface grouping all {@link EffectiveStatement}s which are accessible via
- * {@link SchemaTreeAwareEffectiveStatement.Namespace}. This such statement corresponds to a {@code schema node}.
- *
- * <p>
- * This interface could be named {@code SchemaNodeEffectiveStatement}, but that could induce a notion that it has
- * something to do with {@link SchemaNode} -- which it has not. SchemaNode semantics are wrong in may aspects
- * and while implementations of this interface may also implement SchemaNode, the semantics of this interface should
- * always be preferred and SchemaNode is to be treated as deprecated whenever possible.
- *
- * @param <D> Declared statement type
- * @author Robert Varga
- */
-@Beta
-public interface SchemaTreeEffectiveStatement<D extends DeclaredStatement<QName>>
-    extends NamespacedEffectiveStatement<D> {
-
-}
index ad8dea7b8e5725978c2e0c5ec2454c39c397c179..e230ab7064eb99245d74849f9661e6ab76219ab4 100644 (file)
@@ -35,7 +35,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.parser.spi.source.AugmentToChoiceNamespace;
 
 public abstract class AbstractEffectiveDocumentedDataNodeContainer<A, D extends DeclaredStatement<A>>
-        extends AbstractSchemaEffectiveDocumentedNode<A, D> implements DataNodeContainer {
+        extends AbstractEffectiveDocumentedNode<A, D> implements DataNodeContainer {
 
     private final Map<QName, DataSchemaNode> childNodes;
     private final Set<GroupingDefinition> groupings;
index 22148d3024deccb295e99bb93df279cfba286c46..6621bc20f8bc7a3a02e95d0b194e123d26a21ef5 100644 (file)
@@ -69,7 +69,7 @@ import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 
 @Beta
 public abstract class AbstractEffectiveModule<D extends DeclaredStatement<String>> extends
-        AbstractSchemaEffectiveDocumentedNode<String, D> implements Module, MutableStatement {
+        AbstractEffectiveDocumentedNode<String, D> implements Module, MutableStatement {
     private final String name;
     private final String prefix;
     private final YangVersion yangVersion;
index 11b441531e5f0d0820b00abd8b32a1a2e3fd22fa..18f9c91fb9cccefd36b279e114917516ec0c7c8a 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 
 public abstract class AbstractEffectiveSchemaNode<D extends DeclaredStatement<QName>> extends
-        AbstractSchemaEffectiveDocumentedNode<QName, D> implements SchemaNode {
+        AbstractEffectiveDocumentedNode<QName, D> implements SchemaNode {
 
     private final SchemaPath path;
     private final List<UnknownSchemaNode> unknownNodes;
diff --git a/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractSchemaEffectiveDocumentedNode.java b/yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractSchemaEffectiveDocumentedNode.java
deleted file mode 100644 (file)
index a3ccf19..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2018 Pantheon Technologies, 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.rfc7950.stmt;
-
-import com.google.common.annotations.Beta;
-import com.google.common.collect.ImmutableMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Optional;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
-import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeAwareEffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeEffectiveStatement;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
-import org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReference;
-
-/**
- * An {@link AbstractEffectiveDocumentedNode} which can optionally support {@link SchemaTreeAwareEffectiveStatement}.
- *
- * @param <A> Argument type ({@link Void} if statement does not have argument.)
- * @param <D> Class representing declared version of this statement.
- * @author Robert Varga
- */
-@Beta
-public abstract class AbstractSchemaEffectiveDocumentedNode<A, D extends DeclaredStatement<A>>
-        extends AbstractEffectiveDocumentedNode<A, D> {
-
-    private final Map<QName, SchemaTreeEffectiveStatement<?>> schemaTreeNamespace;
-
-    protected AbstractSchemaEffectiveDocumentedNode(final StmtContext<A, D, ?> ctx) {
-        super(ctx);
-
-        if (this instanceof SchemaTreeAwareEffectiveStatement) {
-            final StatementSourceReference ref = ctx.getStatementSourceReference();
-            final Map<QName, SchemaTreeEffectiveStatement<?>> schemaChildren = new LinkedHashMap<>();
-            streamEffectiveSubstatements(SchemaTreeEffectiveStatement.class).forEach(child -> {
-                putChild(schemaChildren, child, ref, "schema");
-            });
-            schemaTreeNamespace = ImmutableMap.copyOf(schemaChildren);
-        } else {
-            schemaTreeNamespace = ImmutableMap.of();
-        }
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    protected <K, V, N extends IdentifierNamespace<K, V>> Optional<? extends Map<K, V>> getNamespaceContents(
-            final Class<N> namespace) {
-        if (this instanceof SchemaTreeAwareEffectiveStatement
-                && SchemaTreeAwareEffectiveStatement.Namespace.class.equals(namespace)) {
-            return Optional.of((Map<K, V>) schemaTreeNamespace);
-        }
-        return super.getNamespaceContents(namespace);
-    }
-
-    private static <T extends SchemaTreeEffectiveStatement<?>> void putChild(final Map<QName, T> map,
-            final T child, final StatementSourceReference ref, final String tree) {
-        final QName id = child.getIdentifier();
-        final T prev = map.putIfAbsent(id, child);
-        SourceException.throwIf(prev != null, ref,
-                "Cannot add %s tree child with name %s, a conflicting child already exists", tree, id);
-    }
-}
index c38505adc770791f2eb6a66672b7317a5daea36d..6f768095cec40a16b63bf5c2dac44423964e3c5c 100644 (file)
@@ -25,7 +25,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.CopyType;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 
 public abstract class UnknownEffectiveStatementBase<A, D extends UnknownStatement<A>>
-        extends AbstractSchemaEffectiveDocumentedNode<A, D> implements UnknownSchemaNode {
+        extends AbstractEffectiveDocumentedNode<A, D> implements UnknownSchemaNode {
 
     private final boolean addedByUses;
     private final boolean addedByAugmentation;