Note DataTreeSnapshot's duplication of getSchemaContext(), which
is indicative of a coupling to yang.model.api. This is fine for now,
as this coupling already exists through xpath interfaces, but it
needs to be revisited and cleaned by either removing the method,
or making it a non-default (and inherited from SchemaContextProvider).
Change-Id: If335f178e9e086b8b5185044a06d4296f81b2a74
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
ccdb5a655b07693eedbe96d4d5215ff52cbfd671)
*
* @return Current schema context.
*/
- // FIXME: 3.0.0: Make this method non-default.
+ // FIXME: 3.0.0: This method provides a strong tie to yang.model.api. It either needs to be removed or inherited
+ // by extending SchemaContextProvider. This strictly is an implementation detail.
default @NonNull SchemaContext getSchemaContext() {
throw new UnsupportedOperationException("Not implemented by " + getClass());
}
import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode;
import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-final class InMemoryDataTreeModification extends AbstractCursorAware implements CursorAwareDataTreeModification {
+final class InMemoryDataTreeModification extends AbstractCursorAware implements CursorAwareDataTreeModification,
+ SchemaContextProvider {
private static final AtomicIntegerFieldUpdater<InMemoryDataTreeModification> SEALED_UPDATER =
AtomicIntegerFieldUpdater.newUpdater(InMemoryDataTreeModification.class, "sealed");
private static final Logger LOG = LoggerFactory.getLogger(InMemoryDataTreeModification.class);
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshotCursor;
import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider;
-final class InMemoryDataTreeSnapshot extends AbstractCursorAware implements CursorAwareDataTreeSnapshot {
+final class InMemoryDataTreeSnapshot extends AbstractCursorAware implements CursorAwareDataTreeSnapshot,
+ SchemaContextProvider {
private final @NonNull RootModificationApplyOperation applyOper;
private final @NonNull SchemaContext schemaContext;
private final @NonNull TreeNode rootNode;