From: Robert Varga Date: Tue, 13 Jun 2023 10:18:39 +0000 (+0200) Subject: Adjust to YangTextSchemaSource being a CharSource X-Git-Tag: v12.0.0~84 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=7f130510a294fda91f6b661aaaa44a4029e2e0f5;p=mdsal.git Adjust to YangTextSchemaSource being a CharSource YANGTOOLS-1508 changed the interface here, adjust to it by using delegateForCharSource() instead. Change-Id: I20327d4ff7b8f023f18755104ef9b9b581fd24c5 Signed-off-by: Robert Varga --- diff --git a/binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/mdsal/binding/runtime/spi/DefaultModuleInfoSnapshot.java b/binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/mdsal/binding/runtime/spi/DefaultModuleInfoSnapshot.java index 1f0a238d99..d5f4971a98 100644 --- a/binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/mdsal/binding/runtime/spi/DefaultModuleInfoSnapshot.java +++ b/binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/mdsal/binding/runtime/spi/DefaultModuleInfoSnapshot.java @@ -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 diff --git a/binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/mdsal/binding/runtime/spi/ModuleInfoSnapshotResolver.java b/binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/mdsal/binding/runtime/spi/ModuleInfoSnapshotResolver.java index 6eac08fa3d..458a7bc141 100644 --- a/binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/mdsal/binding/runtime/spi/ModuleInfoSnapshotResolver.java +++ b/binding/mdsal-binding-runtime-spi/src/main/java/org/opendaylight/mdsal/binding/runtime/spi/ModuleInfoSnapshotResolver.java @@ -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) { diff --git a/dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/Rpcs.java b/dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/Rpcs.java index 36e4ae260a..22f77b0471 100644 --- a/dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/Rpcs.java +++ b/dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/Rpcs.java @@ -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"); diff --git a/dom/mdsal-dom-spi/src/test/java/org/opendaylight/mdsal/dom/spi/ContentRoutedRpcContextTest.java b/dom/mdsal-dom-spi/src/test/java/org/opendaylight/mdsal/dom/spi/ContentRoutedRpcContextTest.java index be1b6b3682..93d97f1097 100644 --- a/dom/mdsal-dom-spi/src/test/java/org/opendaylight/mdsal/dom/spi/ContentRoutedRpcContextTest.java +++ b/dom/mdsal-dom-spi/src/test/java/org/opendaylight/mdsal/dom/spi/ContentRoutedRpcContextTest.java @@ -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()