Remove ImportResolutionMode.SEMVER_LATEST 64/100964/4
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 4 May 2022 09:37:00 +0000 (11:37 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 4 May 2022 10:56:32 +0000 (12:56 +0200)
This import mode does not have any generator which would use it. Remove
it.

JIRA: YANGTOOLS-1432
Change-Id: I060c098d97efdedd90e184912f760e0ceb8fa805
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
plugin/plugin-generator-api/src/main/java/org/opendaylight/yangtools/plugin/generator/api/FileGenerator.java
plugin/yang-maven-plugin-spi/src/main/java/org/opendaylight/yangtools/yang2sources/spi/BasicCodeGenerator.java
plugin/yang-maven-plugin/src/main/java/org/opendaylight/yangtools/yang2sources/plugin/GeneratorTaskFactory.java

index f255817de9edd10ae0e2ca510d3e5215c106be1b..9385c2a1c65e21a50c1cf6b5b7428b24db23ae54 100644 (file)
@@ -60,13 +60,6 @@ public interface FileGenerator {
          * Standard, RFC6020 and RFC7950 compliant mode. Imports are satisfied by exact revision match (if specified),
          * or by latest available revision.
          */
-        REVISION_EXACT_OR_LATEST,
-        /**
-         * Semantic version based mode. Imports which specify a semantic version (via the OpenConfig extension) will
-         * be satisfied by module which exports the latest compatible revision. Imports which do not specify semantic
-         * version will be resolved just as they would be via {@link #REVISION_EXACT_OR_LATEST}.
-         */
-        @Deprecated(since = "7.0.11", forRemoval = true)
-        SEMVER_LATEST,
+        REVISION_EXACT_OR_LATEST;
     }
 }
index 81978592c8c80678e0c9d14fd0e2397d1fee7b6d..8ecae2243b91ad02ea1534c210843993c3f03e34 100644 (file)
@@ -29,16 +29,7 @@ public interface BasicCodeGenerator {
          * Standard, RFC6020 and RFC7950 compliant mode. Imports are satisfied by exact revision match (if specified),
          * or by latest available revision.
          */
-        REVISION_EXACT_OR_LATEST(FileGenerator.ImportResolutionMode.REVISION_EXACT_OR_LATEST),
-        /**
-         * Semantic version based mode. Imports which specify a semantic version (via the OpenConfig extension) will
-         * be satisfied by module which exports the latest compatible revision. Imports which do not specify semantic
-         * version will be resolved just as they would be via {@link #REVISION_EXACT_OR_LATEST}.
-         *
-         * @deprecated This mode has no users and is deprecated for removal.
-         */
-        @Deprecated(forRemoval = true, since = "8.0.4")
-        SEMVER_LATEST(FileGenerator.ImportResolutionMode.SEMVER_LATEST);
+        REVISION_EXACT_OR_LATEST(FileGenerator.ImportResolutionMode.REVISION_EXACT_OR_LATEST);
 
         private final FileGenerator.@NonNull ImportResolutionMode fileGeneratorMode;
 
index 648b79826930d71ece0043a5b8d09709bfe3dbe0..802b2fcea07494c2243884a40b4564271cccd8ae 100644 (file)
@@ -16,23 +16,12 @@ import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration;
 
 @NonNullByDefault
 abstract class GeneratorTaskFactory extends ParserConfigAware {
-    private static final YangParserConfiguration SEMVER_CONFIG = YangParserConfiguration.builder()
-        .importResolutionMode(org.opendaylight.yangtools.yang.parser.api.ImportResolutionMode.OPENCONFIG_SEMVER)
-        .build();
-
     private final YangParserConfiguration parserConfig;
 
     GeneratorTaskFactory(final ImportResolutionMode importMode) {
-        switch (importMode) {
-            case REVISION_EXACT_OR_LATEST:
-                parserConfig = YangParserConfiguration.DEFAULT;
-                break;
-            case SEMVER_LATEST:
-                parserConfig = SEMVER_CONFIG;
-                break;
-            default:
-                throw new LinkageError("Unhandled import mode " + importMode);
-        }
+        parserConfig = switch (importMode) {
+            case REVISION_EXACT_OR_LATEST -> YangParserConfiguration.DEFAULT;
+        };
     }
 
     @Override