File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
main/java/com/github/underscore/lodash
test/java/com/github/underscore/lodash Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1997,7 +1997,12 @@ public static Object fromXml(final String xml) {
19971997
19981998 @ SuppressWarnings ("unchecked" )
19991999 public static Map <String , Object > fromXmlMap (final String xml ) {
2000- final Object object = Xml .fromXml (xml );
2000+ return fromXmlMap (xml , Xml .FromType .FOR_CONVERT );
2001+ }
2002+
2003+ @ SuppressWarnings ("unchecked" )
2004+ public static Map <String , Object > fromXmlMap (final String xml , final Xml .FromType fromType ) {
2005+ final Object object = Xml .fromXml (xml , fromType );
20012006 final Map <String , Object > result ;
20022007 if (object instanceof Map ) {
20032008 result = (Map <String , Object >) object ;
Original file line number Diff line number Diff line change @@ -3136,6 +3136,10 @@ public void fromXmlMap() {
31363136 "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>"
31373137 + "\n <root></root>" ;
31383138 assertEquals ("{}" , U .fromXmlMap (stringXml2 ).toString ());
3139+ String stringXml3 =
3140+ "<?xml version=\" 1.0\" encoding=\" UTF-8\" ?>"
3141+ + "\n <root></root>" ;
3142+ assertEquals ("{}" , U .fromXmlMap (stringXml3 , Xml .FromType .FOR_CONVERT ).toString ());
31393143 }
31403144
31413145 @ Test (expected = IllegalArgumentException .class )
You can’t perform that action at this time.
0 commit comments