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
1 changed files with 1 additions and 1 deletions

View File

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