Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2019-05-16 11:53:29 -0400
committerJeff Johnston2019-05-16 15:19:42 -0400
commit4028d882feae656baad30becacf728343e29450e (patch)
treef54a2d84a0c86f5928b7a549f7f45ede898471eb /core/org.eclipse.cdt.core
parentbdb0da6b73c5d9f161eea1a0ab99fa060d13f794 (diff)
downloadorg.eclipse.cdt-4028d882feae656baad30becacf728343e29450e.tar.gz
org.eclipse.cdt-4028d882feae656baad30becacf728343e29450e.tar.xz
org.eclipse.cdt-4028d882feae656baad30becacf728343e29450e.zip
Bug 547398 - Fix ConcurrentModificationException in ToolChainManager
- fix references of orderedToolChains list in for loops to use array copy Change-Id: Id6ad9ae5e680ed581a2b3ceddf2bfc19b68dcccd
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/ToolChainManager.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/ToolChainManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/ToolChainManager.java
index 3341a862cc..c13682b6a3 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/ToolChainManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/ToolChainManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 QNX Software Systems and others.
+ * Copyright (c) 2015, 2019 QNX Software Systems and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -117,7 +117,7 @@ public class ToolChainManager implements IToolChainManager {
.node("order"); //$NON-NLS-1$
prefs.put("n", Integer.toString(orderedToolChains.size())); //$NON-NLS-1$
int i = 0;
- for (IToolChain toolChain : orderedToolChains) {
+ for (IToolChain toolChain : orderedToolChains.toArray(new IToolChain[0])) {
prefs.put(Integer.toString(i) + ".type", toolChain.getTypeId()); //$NON-NLS-1$
prefs.put(Integer.toString(i) + ".id", toolChain.getId()); //$NON-NLS-1$
i++;
@@ -191,7 +191,7 @@ public class ToolChainManager implements IToolChainManager {
init();
List<IToolChain> tcs = new ArrayList<>();
if (orderedToolChains != null) {
- for (IToolChain toolChain : orderedToolChains) {
+ for (IToolChain toolChain : orderedToolChains.toArray(new IToolChain[0])) {
boolean matches = true;
for (Map.Entry<String, String> property : properties.entrySet()) {
String tcProperty = toolChain.getProperty(property.getKey());

Back to the top