Fixup LazyLeafOperations 89/84089/3
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 30 Aug 2019 08:58:33 +0000 (10:58 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 30 Aug 2019 10:12:44 +0000 (12:12 +0200)
commite584cb1c6c622cea3a4d1df1e0fe7947abf174dd
treef31300aa319d9a35b2b870387da83d4c5ccde83d
parent01e2593d65b1a8a9a1feb1eb703e14dd0ca26a01
Fixup LazyLeafOperations

LazyLeafOperations.isEnabled() allows code to query whether leaf nodes
are being treated as expendable, hence assumptions about them being
equal on identity can be violated. We retrofit the check into tests we
modified before.

Furthermore users of getValue() expect it to work with identities,
even when it is being specialized to a Collection. The expectation here
is that the same collection will be returned from NormalizedNode,
which we are violating. Fix this up by introducing a new implementation
class, which hides this difference and defers equality to the backing
map.

JIRA: YANGTOOLS-1019
Change-Id: Icf62619c3ea5a1c994c6547a0674b36d707248d3
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
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/LazyValues.java [new file with mode: 0644]
yang/yang-data-jaxen/src/test/java/org/opendaylight/yangtools/yang/data/jaxen/DerefXPathFunctionTest.java