Guard against null data in AbstractLeafCandidateNode 33/21933/2
authorRobert Varga <rovarga@cisco.com>
Wed, 20 May 2015 19:56:22 +0000 (21:56 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 5 Jun 2015 10:44:31 +0000 (10:44 +0000)
commitfe2c484a586350c458a1a9d014896d6aa9e12bb7
treec2a285b1fa77c035e7b2c47b95955b5305921435
parent50f94016ff1543c461de3f77995aa935f8173a69
Guard against null data in AbstractLeafCandidateNode

An instance of this class is defunct if data is ever null, as accessors
will throw a NPE from Optional.of(). Make sure data passed down is never
null, catching any possible offenders.

This transitively fixes the transformation functions, as they will throw
NPE when they get a null input, as per Function API contract.

Change-Id: I8851e3c68dc9aa5abab4874f019fd214b20c0415
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 540b47bdefb25b8edb8481499efcd51d402bd57c)
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractLeafCandidateNode.java