Fixup LazyLeafOperations 05/89805/3
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 30 Aug 2019 08:58:33 +0000 (10:58 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 13 Jul 2020 18:50:52 +0000 (18:50 +0000)
commit7241cf44b7115b5d6c4eb6325718d5f9785ad308
tree67df2f3522a28ae082b712c659c30200f2951e68
parentcbe55e17078de036df1fd19f54aee62a389822f3
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>
(cherry picked from commit e584cb1c6c622cea3a4d1df1e0fe7947abf174dd)
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