X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fnode%2Futils%2Fstream%2FAbstractNormalizedNodeDataOutput.java;h=0506fd2fcf3655196060f5b0ea2821cff8de461c;hb=cd08469088e7a96df6ff1b9b025bff518ab16977;hp=02bebebd2949d397d9234a27215f1e84de0ce299;hpb=733db329220a7d83f78c424da69eeb2c58c4b061;p=controller.git diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataOutput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataOutput.java index 02bebebd29..0506fd2fcf 100755 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataOutput.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataOutput.java @@ -289,7 +289,7 @@ abstract class AbstractNormalizedNodeDataOutput implements NormalizedNodeDataOut LOG.trace("Starting a new augmentation node"); output.writeByte(NodeTypes.AUGMENTATION_NODE); - writeQNameSet(identifier.getPossibleChildNames()); + writeAugmentationIdentifier(identifier); } @Override @@ -411,10 +411,8 @@ abstract class AbstractNormalizedNodeDataOutput implements NormalizedNodeDataOut case PathArgumentTypes.AUGMENTATION_IDENTIFIER : - AugmentationIdentifier augmentationIdentifier = (AugmentationIdentifier) pathArgument; - // No Qname in augmentation identifier - writeQNameSet(augmentationIdentifier.getPossibleChildNames()); + writeAugmentationIdentifier((AugmentationIdentifier) pathArgument); break; default : throw new IllegalStateException("Unknown node identifier type is found : " @@ -435,11 +433,12 @@ abstract class AbstractNormalizedNodeDataOutput implements NormalizedNodeDataOut } } - private void writeQNameSet(final Set children) throws IOException { + void writeAugmentationIdentifier(final AugmentationIdentifier aid) throws IOException { + final Set qnames = aid.getPossibleChildNames(); // Write each child's qname separately, if list is empty send count as 0 - if (children != null && !children.isEmpty()) { - output.writeInt(children.size()); - for (QName qname : children) { + if (!qnames.isEmpty()) { + output.writeInt(qnames.size()); + for (QName qname : qnames) { writeQName(qname); } } else {