Deprecate non-lazy leaf tracking 69/87069/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 21 Jan 2020 15:54:05 +0000 (16:54 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 21 Jan 2020 15:55:31 +0000 (16:55 +0100)
org.opendaylight.yangtools.yang.data.impl.schema.nodes.lazy-leaves
property allows to select non-default behavior of retaining Leaf
node instances in their parent containers.

This behavior is going away, make sure we warn users about this
change.

Change-Id: Ia99bd315edd101838e55bc11ce6d8781fd46ac52
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/LazyLeafOperations.java

index dffa923f2a077ef33066da27110867f5923f7a44..087b87d2a6cbded3978cf34d88cf0b8f5ca71a9b 100644 (file)
@@ -43,6 +43,8 @@ import org.slf4j.LoggerFactory;
 @Beta
 public final class LazyLeafOperations {
     private static final Logger LOG = LoggerFactory.getLogger(LazyLeafOperations.class);
+
+    // FIXME: 6.0.0: remove this knob
     private static final String EXPENDABLE_PROP_NAME =
             "org.opendaylight.yangtools.yang.data.impl.schema.nodes.lazy-leaves";
 
@@ -51,11 +53,14 @@ public final class LazyLeafOperations {
      * {@link LeafSetEntryNode} as an expendable object. This constant is controlled by {@value #EXPENDABLE_PROP_NAME}
      * system property.
      */
+    // FIXME: 6.0.0: remove this knob
     private static final boolean EXPENDABLE;
 
     static {
         EXPENDABLE = Boolean.parseBoolean(System.getProperty(EXPENDABLE_PROP_NAME, "true"));
-        LOG.info("Leaf nodes are treated as {} nodes", EXPENDABLE ? "transient" : "regular");
+        if (!EXPENDABLE) {
+            LOG.warn("Leaf nodes are treated as regular nodes. This option is deprecated and is schedule for removal.");
+        }
     }
 
     private LazyLeafOperations() {
@@ -68,6 +73,7 @@ public final class LazyLeafOperations {
      * @return True if NormalizedNode implementations in this artifact are treating leaf nodes as transient, i.e. do
      *              not retain them.
      */
+    // FIXME: 6.0.0: remove this method
     public static boolean isEnabled() {
         return EXPENDABLE;
     }