Adjust to YangTextSchemaSource being a CharSource 59/106459/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 13 Jun 2023 10:18:39 +0000 (12:18 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 13 Jun 2023 10:19:20 +0000 (12:19 +0200)
YANGTOOLS-1508 changed the interface here, adjust to it by using
delegateForCharSource() instead.

Change-Id: I20327d4ff7b8f023f18755104ef9b9b581fd24c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/mdsal/binding/runtime/spi/DefaultModuleInfoSnapshot.java
binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/mdsal/binding/runtime/spi/ModuleInfoSnapshotResolver.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/Rpcs.java
dom/mdsal-dom-spi/src/test/java/org/opendaylight/mdsal/dom/spi/ContentRoutedRpcContextTest.java

index 1f0a238d99e3d00c66f671359f08391ec2987712..d5f4971a98cb0fcebcbffb49f3115064492a9310 100644 (file)
@@ -46,8 +46,8 @@ final class DefaultModuleInfoSnapshot implements ModuleInfoSnapshot {
             return Futures.immediateFailedFuture(
                 new MissingSchemaSourceException("No source registered", sourceIdentifier));
         }
-        return Futures.immediateFuture(YangTextSchemaSource.delegateForByteSource(sourceIdentifier,
-                    info.getYangTextByteSource()));
+        return Futures.immediateFuture(YangTextSchemaSource.delegateForCharSource(sourceIdentifier,
+                    info.getYangTextCharSource()));
     }
 
     @Override
index 6eac08fa3d001e6272374c462777dd7309082a10..458a7bc141e70afa095acfb118180c701627267f 100644 (file)
@@ -226,13 +226,13 @@ public final class ModuleInfoSnapshotResolver implements Mutable {
     }
 
     static @NonNull YangTextSchemaSource toYangTextSource(final YangModuleInfo moduleInfo) {
-        return YangTextSchemaSource.delegateForByteSource(sourceIdentifierFrom(moduleInfo),
-            moduleInfo.getYangTextByteSource());
+        return YangTextSchemaSource.delegateForCharSource(sourceIdentifierFrom(moduleInfo),
+            moduleInfo.getYangTextCharSource());
     }
 
     private static @NonNull YangTextSchemaSource toYangTextSource(final SourceIdentifier identifier,
             final YangModuleInfo moduleInfo) {
-        return YangTextSchemaSource.delegateForByteSource(identifier, moduleInfo.getYangTextByteSource());
+        return YangTextSchemaSource.delegateForCharSource(identifier, moduleInfo.getYangTextCharSource());
     }
 
     private static SourceIdentifier sourceIdentifierFrom(final YangModuleInfo moduleInfo) {
index 36e4ae260ac94df76ea5a19198879df3d63081cb..22f77b047101ffacaf8ede1f2b385a39100991ab 100644 (file)
@@ -19,8 +19,8 @@ import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 final class Rpcs {
     static final EffectiveModelContext CONTEXT = YangParserTestUtils.parseYangSources(YangParserConfiguration.DEFAULT,
         null,
-        YangTextSchemaSource.delegateForByteSource("yang-ext.yang",
-            $YangModuleInfoImpl.getInstance().getYangTextByteSource()),
+        YangTextSchemaSource.delegateForCharSource("yang-ext.yang",
+            $YangModuleInfoImpl.getInstance().getYangTextCharSource()),
         YangTextSchemaSource.forResource(Rpcs.class, "/rpcs.yang"));
 
     static final QName FOO = QName.create("rpcs", "foo");
index be1b6b368297b70454602805d052463447f3b347..93d97f1097f848138f6239606279e290f7da1dfd 100644 (file)
@@ -29,8 +29,8 @@ public class ContentRoutedRpcContextTest {
     @BeforeClass
     public static void beforeClass() {
         final var ctx = YangParserTestUtils.parseYangSources(YangParserConfiguration.DEFAULT, null,
-            YangTextSchemaSource.delegateForByteSource("yang-ext.yang",
-                $YangModuleInfoImpl.getInstance().getYangTextByteSource()),
+            YangTextSchemaSource.delegateForCharSource("yang-ext.yang",
+                $YangModuleInfoImpl.getInstance().getYangTextCharSource()),
             YangTextSchemaSource.forResource(ContentRoutedRpcContext.class, "/rpc-routing-strategy.yang"));
 
         RPCS = ctx.findModuleStatements("foo").iterator().next()