From bd43cf93ac2b18c7dd738087120fa281221da644 Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Mon, 14 Mar 2011 20:57:35 -0700 Subject: [PATCH] ConcurrentModificationException in AbstractPropertiesFieldsPart I ran into a ConcurrentModificationException when creating an XML file using the plain XML wizard (not the Android XML wizard - because I wanted to create an XML drawable which is not supported by the new Android XML wizard.) Change-Id: Id2ae606e9da47e6f7d42cf6a0dea61eb3e9ca15d --- .../adt/internal/editors/export/AbstractPropertiesFieldsPart.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/export/AbstractPropertiesFieldsPart.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/export/AbstractPropertiesFieldsPart.java index 06169d27b..0d72614d9 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/export/AbstractPropertiesFieldsPart.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/export/AbstractPropertiesFieldsPart.java @@ -34,6 +34,7 @@ import org.eclipse.ui.forms.widgets.Section; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; /** * Section part for editing fields of a properties file in an Export editor. @@ -302,13 +303,15 @@ abstract class AbstractPropertiesFieldsPart extends ManifestSectionPart { } // Clear the text of any keyword we didn't find in the document - for (String key : allKeywords) { + Iterator iterator = allKeywords.iterator(); + while (iterator.hasNext()) { + String key = iterator.next(); Control field = mNameToField.get(key); if (field != null) { try { mInternalTextUpdate = true; setFieldText(field, ""); - allKeywords.remove(key); + iterator.remove(); } finally { mInternalTextUpdate = false; } -- 2.11.0