Add more deprecations around SchemaPath 19/97919/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 16 Oct 2021 09:13:04 +0000 (11:13 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 16 Oct 2021 09:13:04 +0000 (11:13 +0200)
We have a few constructs which provide bridging to SchemaPath, which
are now triggering warnings. Deprecate them, so that we suppress
warnings and give users some time to adjust.

Change-Id: I4cdfd47cceacceca27e6a155a87999c97ea7a490
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/PathFromRoot.java
model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaNodeIdentifier.java

index ca30dd03ba4c714512e4708f61c81c5fe906b5d7..7b70b1743d5dc63ddf859c3566938e414c9b68ac 100644 (file)
@@ -22,6 +22,7 @@ import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.concepts.Immutable;
 import org.opendaylight.yangtools.yang.common.QName;
 
+@Deprecated(since = "7.0.9", forRemoval = true)
 final class PathFromRoot extends AbstractList<QName> implements Immutable {
     private static final QName[] EMPTY_QNAMES = new QName[0];
     private static final VarHandle QNAMES;
index dd4c0cb624f3bb2f01c7c74c9a9b7e3fe9e9fb61..029d963af1adea3684b91cc57d2e282e32f95bcc 100644 (file)
@@ -87,6 +87,7 @@ public abstract class SchemaNodeIdentifier implements Immutable {
         }
 
         @Override
+        @Deprecated(since = "7.0.9", forRemoval = true)
         final SchemaPath implicitSchemaPathParent() {
             return SchemaPath.ROOT;
         }
@@ -142,6 +143,7 @@ public abstract class SchemaNodeIdentifier implements Immutable {
         }
 
         @Override
+        @Deprecated(since = "7.0.9", forRemoval = true)
         final SchemaPath implicitSchemaPathParent() {
             return SchemaPath.SAME;
         }
@@ -244,10 +246,12 @@ public abstract class SchemaNodeIdentifier implements Immutable {
         }
     }
 
+    @Deprecated(since = "7.0.9", forRemoval = true)
     private static final AtomicReferenceFieldUpdater<SchemaNodeIdentifier, SchemaPath> SCHEMAPATH_UPDATER =
             AtomicReferenceFieldUpdater.newUpdater(SchemaNodeIdentifier.class, SchemaPath.class, "schemaPath");
 
     // Cached SchemaPath.
+    @Deprecated(since = "7.0.9", forRemoval = true)
     private volatile SchemaPath schemaPath;
     // Cached hashCode
     private volatile int hash;
@@ -288,7 +292,9 @@ public abstract class SchemaNodeIdentifier implements Immutable {
      * Create the {@link SchemaPath} equivalent of this identifier.
      *
      * @return SchemaPath equivalent.
+     * @deprecated This method is scheduled for removal along with {@link SchemaPath}.
      */
+    @Deprecated(since = "7.0.9", forRemoval = true)
     public final @NonNull SchemaPath asSchemaPath() {
         final SchemaPath ret = schemaPath;
         return ret != null ? ret : loadSchemaPath();
@@ -311,12 +317,14 @@ public abstract class SchemaNodeIdentifier implements Immutable {
         return MoreObjects.toStringHelper(className()).add("qnames", toStringQNames()).toString();
     }
 
+    @Deprecated(since = "7.0.9", forRemoval = true)
     abstract @NonNull SchemaPath implicitSchemaPathParent();
 
     abstract @NonNull Object pathObject();
 
     abstract @NonNull String className();
 
+    @Deprecated(since = "7.0.9", forRemoval = true)
     private @NonNull SchemaPath loadSchemaPath() {
         final SchemaPath newPath = implicitSchemaPathParent().createChild(getNodeIdentifiers());
         return SCHEMAPATH_UPDATER.compareAndSet(this, null, newPath) ? newPath : schemaPath;