Deprecate AddedByUsesAware 20/97920/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 16 Oct 2021 09:28:31 +0000 (11:28 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 16 Oct 2021 09:29:44 +0000 (11:29 +0200)
isAddedByUses() is used only by mdsal's binding components, which should
be able to get by without this guidance. Deprecate the interface along
with its support bits.

JIRA: YANGTOOLS-1351
Change-Id: Ic8b07b995f49cece48d1a90ed51723485d88120d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
model/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/AddedByUsesAware.java
model/yang-model-spi/src/main/java/org/opendaylight/yangtools/yang/model/spi/meta/AbstractEffectiveUnknownSchmemaNode.java
model/yang-model-spi/src/main/java/org/opendaylight/yangtools/yang/model/spi/meta/EffectiveStatementMixins.java
parser/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/StatementContextBase.java

index d7e43c49b946c888ffb186e3262eda297456b45f..e73318ab327db1cd3b46543d027848c7b12af371 100644 (file)
@@ -11,16 +11,17 @@ import com.google.common.annotations.Beta;
 
 /**
  * Trait interface for {@link SchemaNode}s, which have the {@link #isAddedByUses()} method.
+ *
+ * @deprecated The only user of this trait is MD-SAL's binding component. As such, we provide enough information in
+ *             EffectiveStatement tree to reconstruct this information.
  */
 @Beta
-//FIXME: 8.0.0: refactor this interface to take into account DerivableSchemaNode
+@Deprecated(since = "7.0.9")
 public interface AddedByUsesAware {
     /**
-     * Returns <code>true</code> if this node was added by uses statement,
-     * otherwise returns <code>false</code>.
+     * Returns {@code true} if this node was added by uses statement, otherwise returns {@code false}.
      *
-     * @return <code>true</code> if this node was added by uses statement,
-     *         otherwise returns <code>false</code>
+     * @return {@code true} if this node was added by uses statement, otherwise returns {@code false}
      */
     boolean isAddedByUses();
 }
index 6756904fc157945a7c4214b0ff14950274e79d9c..da6ccf2727bcf7d25b0e7088578ae604c08f6ad4 100644 (file)
@@ -33,6 +33,7 @@ public abstract class AbstractEffectiveUnknownSchmemaNode<A, D extends UnknownSt
     private final @NonNull ImmutableList<? extends EffectiveStatement<?, ?>> substatements;
     private final @NonNull D declared;
     private final @NonNull A argument;
+    @Deprecated(since = "7.0.9")
     private final boolean addedByUses;
     private final boolean augmenting;
 
index dc93fd2b73450fc55f9aead3d888eb0807e17f2c..2a613de087ec309cbae72b5f2c718e1c612302fc 100644 (file)
@@ -95,10 +95,13 @@ public final class EffectiveStatementMixins {
      *
      * @param <A> Argument type ({@link Empty} if statement does not have argument.)
      * @param <D> Class representing declared version of this statement.
+     * @deprecated See deprecation notice in {@link AddedByUsesAware}
      */
+    @Deprecated(since = "7.0.9")
     public interface AddedByUsesMixin<A, D extends DeclaredStatement<A>>
             extends EffectiveStatementWithFlags<A, D>, AddedByUsesAware {
         @Override
+        @Deprecated(since = "7.0.9")
         default boolean isAddedByUses() {
             return (flags() & FlagsBuilder.ADDED_BY_USES) != 0;
         }
@@ -462,6 +465,7 @@ public final class EffectiveStatementMixins {
             static final int MANDATORY            = 0x0004;
 
             static final int AUGMENTING           = 0x0010;
+            @Deprecated(since = "7.0.9")
             static final int ADDED_BY_USES        = 0x0020;
             private static final int MASK_HISTORY = 0x0030;
 
index 9c537eafcac9fbc40222d32006c025a80795b4ae..c797dacaf5a1d3ac5464d0baff0f9e329bfdc375 100644 (file)
@@ -99,6 +99,7 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
     // Bottom 4 bits, encoding a CopyHistory, aight?
     private static final byte COPY_ORIGINAL              = 0x00;
     private static final byte COPY_LAST_TYPE_MASK        = 0x03;
+    @Deprecated(since = "7.0.9")
     private static final byte COPY_ADDED_BY_USES         = 0x04;
     private static final byte COPY_ADDED_BY_AUGMENTATION = 0x08;
 
@@ -218,6 +219,7 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
     }
 
     @Override
+    @Deprecated(since = "7.0.9")
     public final boolean isAddedByUses() {
         return (bitsAight & COPY_ADDED_BY_USES) != 0;
     }