Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fixed advanced Netconf client functionality.
[controller.git]
/
opendaylight
/
md-sal
/
sal-netconf-connector
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
connect
/
netconf
/
XmlDocumentUtils.java
diff --git
a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/XmlDocumentUtils.java
b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/XmlDocumentUtils.java
index 3f6b4e1f4cd9dd75fd1fcb59a3f504970618a7bf..e151fca00969d9bc5e4e29fbe81bc04ca1173c7d 100644
(file)
--- a/
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/XmlDocumentUtils.java
+++ b/
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/XmlDocumentUtils.java
@@
-13,10
+13,12
@@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
+import com.google.common.base.Strings;
+
public class XmlDocumentUtils {
public class XmlDocumentUtils {
- public static
CompositeNode toComposite
Node(Document doc) {
- return
(CompositeNode)
toCompositeNode(doc.getDocumentElement());
+ public static
Node<?> to
Node(Document doc) {
+ return toCompositeNode(doc.getDocumentElement());
}
private static Node<?> toCompositeNode(Element element) {
}
private static Node<?> toCompositeNode(Element element) {
@@
-29,7
+31,7
@@
public class XmlDocumentUtils {
List<Node<?>> values = new ArrayList<>();
NodeList nodes = element.getChildNodes();
List<Node<?>> values = new ArrayList<>();
NodeList nodes = element.getChildNodes();
- boolean isSimpleObject =
fals
e;
+ boolean isSimpleObject =
tru
e;
String value = null;
for (int i = 0; i < nodes.getLength(); i++) {
org.w3c.dom.Node child = nodes.item(i);
String value = null;
for (int i = 0; i < nodes.getLength(); i++) {
org.w3c.dom.Node child = nodes.item(i);
@@
-37,11
+39,10
@@
public class XmlDocumentUtils {
isSimpleObject = false;
values.add(toCompositeNode((Element) child));
}
isSimpleObject = false;
values.add(toCompositeNode((Element) child));
}
- if (
!
isSimpleObject && child instanceof org.w3c.dom.Text) {
+ if (isSimpleObject && child instanceof org.w3c.dom.Text) {
value = element.getTextContent();
value = element.getTextContent();
- if (
value.matches(".*\\w.*"
)) {
+ if (
!Strings.isNullOrEmpty(value
)) {
isSimpleObject = true;
isSimpleObject = true;
- break;
}
}
}
}
}
}