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%2Fxml%2Fcodec%2FXmlUtils.java;h=ea8f4a3ef19810a6d95ebc4211b0f4569b6e2716;hp=5848561676b34ff68b744afa4f5f76b2acd680ca;hb=7f8512fcbe4ac373995b7e2e370d38a01f4eaeec;hpb=f86ed628f2a6b166a9d533459e62e3b3229f4a9f diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/xml/codec/XmlUtils.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/xml/codec/XmlUtils.java index 5848561676..ea8f4a3ef1 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/xml/codec/XmlUtils.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/xml/codec/XmlUtils.java @@ -75,9 +75,13 @@ public class XmlUtils { */ public static String inputCompositeNodeToXml(CompositeNode cNode, SchemaContext schemaContext){ LOG.debug("Converting input composite node to xml {}", cNode); - if (cNode == null) return BLANK; + if (cNode == null) { + return BLANK; + } - if(schemaContext == null) return BLANK; + if(schemaContext == null) { + return BLANK; + } Document domTree = null; try { @@ -108,9 +112,13 @@ public class XmlUtils { */ public static String outputCompositeNodeToXml(CompositeNode cNode, SchemaContext schemaContext){ LOG.debug("Converting output composite node to xml {}", cNode); - if (cNode == null) return BLANK; + if (cNode == null) { + return BLANK; + } - if(schemaContext == null) return BLANK; + if(schemaContext == null) { + return BLANK; + } Document domTree = null; try { @@ -150,7 +158,9 @@ public class XmlUtils { } public static CompositeNode xmlToCompositeNode(String xml){ - if (xml==null || xml.length()==0) return null; + if (xml==null || xml.length()==0) { + return null; + } Node dataTree; try { @@ -179,11 +189,17 @@ public class XmlUtils { */ public static CompositeNode inputXmlToCompositeNode(QName rpc, String xml, SchemaContext schemaContext){ LOG.debug("Converting input xml to composite node {}", xml); - if (xml==null || xml.length()==0) return null; + if (xml==null || xml.length()==0) { + return null; + } - if(rpc == null) return null; + if(rpc == null) { + return null; + } - if(schemaContext == null) return null; + if(schemaContext == null) { + return null; + } CompositeNode compositeNode = null; try { @@ -213,7 +229,7 @@ public class XmlUtils { LOG.debug("Converted xml input to list of nodes {}", dataNodes); final CompositeNodeBuilder it = ImmutableCompositeNode.builder(); - it.setQName(input); + it.setQName(rpc); it.add(ImmutableCompositeNode.create(input, dataNodes)); compositeNode = it.toInstance(); break;