Fix data/schema tree reuse 81/95181/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 15 Feb 2021 20:35:32 +0000 (21:35 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 15 Feb 2021 20:36:52 +0000 (21:36 +0100)
A simple thinko: we should just clear the flag, not ever
reset it back.

JIRA: YANGTOOLS-1234
Change-Id: I1ecbe4f754788a1a8781ac525e955876e7a8a142
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-model-spi/src/main/java/org/opendaylight/yangtools/yang/model/spi/meta/AbstractEffectiveStatement.java

index 9f3f3412673b61420368c1afe4a96e2752dce74b..ffe226f74e129b1c2a7a225fb1fd240dfe714790 100644 (file)
@@ -99,7 +99,9 @@ abstract class AbstractEffectiveStatement<A, D extends DeclaredStatement<A>>
         boolean sameAsSchema = true;
 
         for (SchemaTreeEffectiveStatement<?> child : schemaTreeStatements) {
-            sameAsSchema = indexDataTree(dataChildren, child);
+            if (!indexDataTree(dataChildren, child)) {
+                sameAsSchema = false;
+            }
         }
 
         // This is a mighty hack to lower memory usage: if we consumed all schema tree children as data nodes,