mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +01:00
Use Enum.toString() instead of Enum.name() in XmlStringBuilder.optElement()
This commit is contained in:
parent
01f9b228f2
commit
00ce194109
1 changed files with 3 additions and 1 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue