1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-06-17 08:54:49 +02: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) { 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) { public XmlStringBuilder emptyElement(String element) {