Fix DataNodeContainerMixin.getChildNodes() 97/87497/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 6 Feb 2020 17:07:53 +0000 (18:07 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 6 Feb 2020 17:10:50 +0000 (18:10 +0100)
Since our implementation relies hashCode()/equals(), we really
want to make sure same-source comparison ends up being equal,
hence we collect to a list (which is faster than a set). This is
okay, as all equality checks sit behind an implementation instanceof.

JIRA: YANGTOOLS-1065
Change-Id: I521a8a7cfc2af012928da55708a0a519dae85095
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/EffectiveStatementMixins.java

index 4d1045d0feb4e2a24fc3eaab8087a933350006f0..c2b82e7f7dc9b789aff8686968c1012c851a540e 100644 (file)
@@ -179,7 +179,8 @@ public final class EffectiveStatementMixins {
 
         @Override
         default Collection<DataSchemaNode> getChildNodes() {
-            return filterEffectiveStatements(DataSchemaNode.class);
+            // Note: two invocations must end up being equal
+            return filterEffectiveStatementsList(DataSchemaNode.class);
         }
 
         @Override