mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
Bug 547398 - Fix ConcurrentModificationException in ToolChainManager
- fix references of orderedToolChains list in for loops to use array copy Change-Id: Id6ad9ae5e680ed581a2b3ceddf2bfc19b68dcccd
This commit is contained in:
parent
bdb0da6b73
commit
4028d882fe
1 changed files with 3 additions and 3 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Reference in a new issue