From fb3a71a14dcd5b43cbf2850ea678603f8b487bdd Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 18 Sep 2019 08:48:39 +0200 Subject: [PATCH] Fix ConcurrentModificationException in XmlStringBuilder.appendToXml() We want to append to appendable, not sb, the LazyStringBuilder we are currently iterating over, --- .../main/java/org/jivesoftware/smack/util/XmlStringBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java b/smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java index acf5ac1b4..ae8b2931b 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java @@ -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); } }