X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fnode%2Futils%2Fstream%2FNormalizedNodeInputStreamReader.java;h=cc744438ff627b64594847323623b72cae6772c7;hp=3b912e6cb9064e2bd7ff50a5bbaa72e629eea131;hb=77f491931ec07f6972869b8cbfa2207857990cec;hpb=162032384e6a580f5926956bddf0b1e74b5fa7bd diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java index 3b912e6cb9..cc744438ff 100755 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java @@ -27,6 +27,7 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.dom.DOMSource; import org.opendaylight.controller.cluster.datastore.node.utils.QNameFactory; +import org.opendaylight.yangtools.yang.common.Empty; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; @@ -333,6 +334,15 @@ public class NormalizedNodeInputStreamReader implements NormalizedNodeDataInput case ValueTypes.YANG_IDENTIFIER_TYPE : return readYangInstanceIdentifierInternal(); + case ValueTypes.EMPTY_TYPE: + // Leaf nodes no longer allow null values and thus we no longer emit null values. Previously, the "empty" + // yang type was represented as null so we translate an incoming null value to Empty. It was possible for + // a BI user to set a string leaf to null and we're rolling the dice here but the chances for that are + // very low. We'd have to know the yang type but, even if we did, we can't let a null value pass upstream + // so we'd have to drop the leaf which might cause other issues. + case ValueTypes.NULL_TYPE: + return Empty.getInstance(); + default : return null; }