@@ -675,7 +675,7 @@ object Xml {
675675 fromType
676676 )
677677 if (checkResult(xml, document, result, fromType)) {
678- (( result as Map <* , * >).entries.iterator().next() as Map . Entry < * , * > ).value
678+ (result as Map <* , * >).entries.iterator().next().value
679679 } else result
680680 } catch (ex: Exception ) {
681681 throw IllegalArgumentException (ex)
@@ -767,7 +767,7 @@ object Xml {
767767 FromType .FOR_CONVERT
768768 )
769769 if (checkResult(xml, document, result, FromType .FOR_CONVERT )) {
770- (( result as Map <* , * >).entries.iterator().next() as Map . Entry < * , * > ).value!!
770+ (result as Map <* , * >).entries.iterator().next().value!!
771771 } else result
772772 } catch (ex: Exception ) {
773773 throw IllegalArgumentException (ex)
@@ -788,7 +788,7 @@ object Xml {
788788 FromType .FOR_CONVERT
789789 )
790790 if (checkResult(xml, document, result, FromType .FOR_CONVERT )) {
791- (( result as Map <* , * >).entries.iterator().next() as Map . Entry < * , * > ).value!!
791+ (result as Map <* , * >).entries.iterator().next().value!!
792792 } else result
793793 } catch (ex: Exception ) {
794794 throw IllegalArgumentException (ex)
@@ -804,19 +804,19 @@ object Xml {
804804 val result: String = if (localString.startsWith(" -" )
805805 && namespaces.contains(
806806 localString.substring(
807- 1 , Math . max(1 , localString.indexOf(' :' ))
807+ 1 , max(1 , localString.indexOf(' :' ))
808808 )
809809 )
810810 ) {
811811 (" -"
812812 + localString.substring(
813- Math . max(0 , localString.indexOf(' :' ) + 1 )
813+ max(0 , localString.indexOf(' :' ) + 1 )
814814 ))
815815 } else if (namespaces.contains(
816- localString.substring(0 , Math . max(0 , localString.indexOf(' :' )))
816+ localString.substring(0 , max(0 , localString.indexOf(' :' )))
817817 )
818818 ) {
819- localString.substring(Math . max(0 , localString.indexOf(' :' ) + 1 ))
819+ localString.substring(max(0 , localString.indexOf(' :' ) + 1 ))
820820 } else {
821821 `object `.toString()
822822 }
@@ -842,10 +842,10 @@ object Xml {
842842 val result: String? = if (localString.startsWith(" -" )) {
843843 null
844844 } else if (namespaces.contains(
845- localString.substring(0 , Math . max(0 , localString.indexOf(' :' )))
845+ localString.substring(0 , max(0 , localString.indexOf(' :' )))
846846 )
847847 ) {
848- localString.substring(Math . max(0 , localString.indexOf(' :' ) + 1 ))
848+ localString.substring(max(0 , localString.indexOf(' :' ) + 1 ))
849849 } else {
850850 `object `.toString()
851851 }
@@ -917,7 +917,7 @@ object Xml {
917917
918918 fun fillSpaces (): XmlStringBuilder {
919919 builder.append(
920- (if (identStep == Step .TABS ) ' \t ' else ' ' ).toString().repeat(Math . max(0 , ident))
920+ (if (identStep == Step .TABS ) ' \t ' else ' ' ).toString().repeat(max(0 , ident))
921921 )
922922 return this
923923 }
@@ -1771,10 +1771,10 @@ object Xml {
17711771 }
17721772 result.append(ch)
17731773 } catch (ex: Exception ) {
1774- result.append(" __" ).append(encode(Character .toString(ch ))).append(" __" )
1774+ result.append(" __" ).append(encode(ch .toString())).append(" __" )
17751775 }
17761776 } else {
1777- result.append(" __" ).append(encode(Character .toString(ch ))).append(" __" )
1777+ result.append(" __" ).append(encode(ch .toString())).append(" __" )
17781778 }
17791779 for (i in 1 until length) {
17801780 ch = name[i]
@@ -1788,11 +1788,11 @@ object Xml {
17881788 result.append(ch)
17891789 } catch (ex: Exception ) {
17901790 result.append(" __" )
1791- .append(encode(Character .toString(ch )))
1791+ .append(encode(ch .toString()))
17921792 .append(" __" )
17931793 }
17941794 } else {
1795- result.append(" __" ).append(encode(Character .toString(ch ))).append(" __" )
1795+ result.append(" __" ).append(encode(ch .toString())).append(" __" )
17961796 }
17971797 }
17981798 return result.toString()
@@ -1886,13 +1886,13 @@ object Xml {
18861886 @JvmStatic
18871887 fun getMapKey (map : Any? ): String {
18881888 return if (map is Map <* , * > && map.isNotEmpty())
1889- ( map.entries.iterator().next() as Map . Entry < * , * > ).key.toString() else " "
1889+ map.entries.iterator().next().key.toString() else " "
18901890 }
18911891
18921892 @JvmStatic
18931893 fun getMapValue (map : Any? ): Any? {
1894- return if (map is Map <* , * > && map.isNotEmpty()) ( map.entries.iterator()
1895- .next() as Map . Entry < * , * >) .value else null
1894+ return if (map is Map <* , * > && map.isNotEmpty()) map.entries.iterator()
1895+ .next().value else null
18961896 }
18971897 }
18981898
0 commit comments