1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +01:00

Use Enum.toString() instead of Enum.name() in XmlStringBuilder.optElement()

This commit is contained in:
Florian Schmaus 2018-10-19 09:16:42 +02:00
parent 01f9b228f2
commit 00ce194109

View file

@ -481,7 +481,9 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
}
public XmlStringBuilder emptyElement(Enum<?> element) {
return emptyElement(element.name());
// Use Enum.toString() instead Enum.name() here, since some enums override toString() in order to replace
// underscores ('_') with dash ('-') for example (name() is declared final in Enum).
return emptyElement(element.toString());
}
public XmlStringBuilder emptyElement(String element) {