Remove ImportedNamespaceContext 52/102152/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 18 Aug 2022 15:41:25 +0000 (17:41 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 18 Aug 2022 21:29:41 +0000 (23:29 +0200)
This indirection is not actually useful, as it only captures generics.
Remove it to simplify our class hierarchy.

JIRA: YANGTOOLS-1453
Change-Id: I2eb4f247bb61f3547fc3a65e8a92ed7d44671e88
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
parser/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/ImportedNamespaceContext.java [deleted file]
parser/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/SourceParserNamespaces.java

diff --git a/parser/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/ImportedNamespaceContext.java b/parser/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/ImportedNamespaceContext.java
deleted file mode 100644 (file)
index d6af8b8..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. 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 java.io.Serial;
-import org.eclipse.jdt.annotation.NonNull;
-
-/**
- * Special namespace which allows import of namespaces from other sources.
- *
- * <p>
- * This namespace and its subclasses are used by model processor to link / import namespaces to context node from
- * supplied {@link StmtContext}.
- *
- * <p>
- * This abstraction allows for imports and includes be implement as derived namespaces of this, but is not tied only for
- * import and include statements.
- *
- * @param <K> Imported context identifier
- */
-public final class ImportedNamespaceContext<K> extends ParserNamespace<K, StmtContext<?, ?, ?>> {
-    @Serial
-    private static final long serialVersionUID = 1L;
-
-    public ImportedNamespaceContext(final @NonNull String name) {
-        super(name);
-    }
-}
index e0e391968920961afe9fd6f6cdd211a3baa57793..39b4d97b8ea2c01c370f6c26e28d581cd17c5d28 100644 (file)
@@ -19,7 +19,6 @@ import org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.ModuleStatement;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 import org.opendaylight.yangtools.yang.parser.spi.ParserNamespaces;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ImportedNamespaceContext;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
@@ -33,8 +32,8 @@ public final class SourceParserNamespaces {
      * to correctly populate prefixes map for actual parsing phase and eventually, resolve QName for any valid declared
      * statement.
      */
-    public static final @NonNull ImportedNamespaceContext<String> BELONGSTO_PREFIX_TO_MODULECTX =
-        new ImportedNamespaceContext<>("belongsto-prefix-to-module");
+    public static final @NonNull ParserNamespace<String, StmtContext<?, ?, ?>> BELONGSTO_PREFIX_TO_MODULECTX =
+        new ParserNamespace<>("belongsto-prefix-to-module");
 
     /**
      * Source-specific mapping of prefixes to namespaces.
@@ -65,13 +64,13 @@ public final class SourceParserNamespaces {
         new ParserNamespace<>("import-prefix-to-modulectx");
 
     // FIXME: document this
-    public static final @NonNull ImportedNamespaceContext<SourceIdentifier> IMPORTED_MODULE =
-        new ImportedNamespaceContext<>("imported-module");
+    public static final @NonNull ParserNamespace<SourceIdentifier, StmtContext<?, ?, ?>> IMPORTED_MODULE =
+        new ParserNamespace<>("imported-module");
 
     // FIXME: document this
     // FIXME: is this 'included submodule' instead?
-    public static final @NonNull ImportedNamespaceContext<SourceIdentifier> INCLUDED_MODULE =
-        new ImportedNamespaceContext<>("included-module");
+    public static final @NonNull ParserNamespace<SourceIdentifier, StmtContext<?, ?, ?>> INCLUDED_MODULE =
+        new ParserNamespace<>("included-module");
 
     /**
      * Source-specific mapping of prefixes to namespaces.