Tolerate empty instance identifier in ImmutableNodes.fromInstanceId() 82/77482/1
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 4 Nov 2018 20:24:28 +0000 (21:24 +0100)
committerRobert Varga <nite@hq.sk>
Sun, 4 Nov 2018 20:29:30 +0000 (20:29 +0000)
commit451fc149d1f71c16fe8dc814e803e0f7ea9cf4ca
treebb2ec4f3fdb54125d1781ae912929fdc2203b624
parent6fd73a016d19cfb336ab12f6eddfc2d5934fb3fc
Tolerate empty instance identifier in ImmutableNodes.fromInstanceId()

If the user specifies an empty InstanceIdentifier, we fail with an
undocumented NoSuchElementException. Make sure we properly handle
this case by returning a container which matches SchemaContext.NAME.

JIRA: YANGTOOLS-914
Change-Id: I0b503d3bed99d73d88e037d35979c503215f3b52
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/ImmutableNodes.java
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/InstanceIdToNodesTest.java