Skip to content

Commit e155d15

Browse files
committed
Improved Xml.checkResult() method.
1 parent c1e833c commit e155d15

File tree

1 file changed

+3
-5
lines changed
  • src/main/java/com/github/underscore/lodash

1 file changed

+3
-5
lines changed

src/main/java/com/github/underscore/lodash/Xml.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,11 +1662,9 @@ private static boolean checkResult(
16621662
} else if (headerAttributes.containsKey(STANDALONE.substring(1))) {
16631663
((Map) result).put(STANDALONE, headerAttributes.get(STANDALONE.substring(1)));
16641664
} else if (fromType == FromType.FOR_CONVERT
1665-
&& ((Map.Entry) ((Map) result).entrySet().iterator().next()).getKey().equals(ROOT)
1666-
&& (((Map.Entry) ((Map) result).entrySet().iterator().next()).getValue()
1667-
instanceof List
1668-
|| ((Map.Entry) ((Map) result).entrySet().iterator().next()).getValue()
1669-
instanceof Map)) {
1665+
&& Xml.XmlValue.getMapKey(result).equals(ROOT)
1666+
&& (Xml.XmlValue.getMapValue(result) instanceof List
1667+
|| Xml.XmlValue.getMapValue(result) instanceof Map)) {
16701668
if (xml.startsWith(XML_HEADER)) {
16711669
return true;
16721670
} else {

0 commit comments

Comments
 (0)