1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 10:37:59 +01:00

[core] Use Enum.toString() in XmlStringBuilder.attribute(String, Enum<?>)

All other enum-using methods of XmlStringBuilder already use
Enum.toString(), as opposed to Enum.name(), this was the only left. I
do not remember why I did not to change this method too, probably
because of its plenty call sites.

But since this method already broke Jingle XML serializaton,
JingleAction was e.g., 'session_accept' when it should be
'session-accept', we change it now.

Fixes SMACK-921.
This commit is contained in:
Florian Schmaus 2022-01-22 11:08:35 +01:00
parent 1a727c152e
commit 1dae0c0c32

View file

@ -289,8 +289,7 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
public XmlStringBuilder attribute(String name, Enum<?> value) {
assert value != null;
// TODO: Should use toString() instead of name().
attribute(name, value.name());
attribute(name, value.toString());
return this;
}