Require symbolic name in {IR,YinDom}SchemaSource 59/95859/5
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 20 Apr 2021 21:40:40 +0000 (23:40 +0200)
committerRobert Varga <nite@hq.sk>
Wed, 21 Apr 2021 05:49:07 +0000 (05:49 +0000)
Constructors which do not take a symbolic name are making it easy to
forget to come up with a strategy. While a symbolic name is not
required, require callers to be explicit about what they want to use.

JIRA: YANGTOOLS-1275
Change-Id: Ib3c253c3d380968bf54a4590551aec61df61bac9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/ir/IRSchemaSource.java
yang/yang-repo-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/YinDomSchemaSource.java

index 96ec99a1d2215322244ee6a09e57fd0845c957c2..8a1257f665fc119c193530acf4aa28e6704f284a 100644 (file)
@@ -45,11 +45,6 @@ public final class IRSchemaSource extends AbstractSimpleIdentifiable<SourceIdent
         checkArgument(rootStatement.argument() != null, "Root statement does not have an argument");
     }
 
-    @Deprecated(forRemoval = true)
-    public IRSchemaSource(final @NonNull SourceIdentifier identifier, final @NonNull IRStatement rootStatement) {
-        this(identifier, rootStatement, null);
-    }
-
     @Override
     public Optional<String> getSymbolicName() {
         return Optional.ofNullable(symbolicName);
index fb1187f46277de271325064683cb886eedc48b8f..bfcae8300eac96c1c94024fcf58767fc96300c91 100644 (file)
@@ -48,20 +48,6 @@ public abstract class YinDomSchemaSource implements YinXmlSchemaSource {
         // Prevent outside instantiation
     }
 
-    /**
-     * Create a new {@link YinDomSchemaSource} using an identifier and a source.
-     *
-     * @param identifier Schema source identifier
-     * @param source W3C DOM source
-     * @return A new {@link YinDomSchemaSource} instance.
-     * @deprecated Use {@link #create(SourceIdentifier, DOMSource, String)} instead.
-     */
-    @Deprecated(forRemoval = true)
-    public static @NonNull YinDomSchemaSource create(final @NonNull SourceIdentifier identifier,
-            final @NonNull DOMSource source) {
-        return create(identifier, source, null);
-    }
-
     /**
      * Create a new {@link YinDomSchemaSource} using an identifier and a source.
      *