1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-25 03:57:58 +01:00

Fix ConcurrentModificationException in XmlStringBuilder.appendToXml()

We want to append to appendable, not sb, the LazyStringBuilder we are
currently iterating over,
This commit is contained in:
Florian Schmaus 2019-09-18 08:48:39 +02:00
parent afd61670a4
commit fb3a71a14d

View file

@ -646,7 +646,7 @@ public class XmlStringBuilder implements Appendable, CharSequence, Element {
else if (csq instanceof XmlNsAttribute) { else if (csq instanceof XmlNsAttribute) {
XmlNsAttribute xmlNsAttribute = (XmlNsAttribute) csq; XmlNsAttribute xmlNsAttribute = (XmlNsAttribute) csq;
if (!xmlNsAttribute.value.equals(enclosingXmlEnvironment.getEffectiveNamespace())) { if (!xmlNsAttribute.value.equals(enclosingXmlEnvironment.getEffectiveNamespace())) {
sb.append(xmlNsAttribute); appendable.append(xmlNsAttribute);
enclosingXmlEnvironment = new XmlEnvironment(xmlNsAttribute.value); enclosingXmlEnvironment = new XmlEnvironment(xmlNsAttribute.value);
} }
} }