1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

Bug 547026 - fix ConcurrentModificationException

- in ContainerGCCToolChainProvider change collection of
  toolchains to be an array before accessing to prevent
  ConcurrentModificationException

Change-Id: Ia39ddee181ba814997a34d5b1d68170fe1cda5ce
This commit is contained in:
Jeff Johnston 2019-05-06 20:12:34 -04:00
parent 0b113d199c
commit db891f98dd

View file

@ -164,7 +164,9 @@ public class ContainerGCCToolChainProvider implements IToolChainProvider, IDocke
try { try {
String connectionURI = connection.getUri(); String connectionURI = connection.getUri();
Collection<IToolChain> toolChains = toolChainManager.getAllToolChains(); Collection<IToolChain> toolChains = toolChainManager.getAllToolChains();
for (IToolChain toolChain : toolChains) { IToolChain[] toolChainArray = toolChains.toArray(new IToolChain[0]);
for (int i = 0; i < toolChains.size(); ++i) {
IToolChain toolChain = toolChainArray[i];
String uri = toolChain.getProperty(IContainerLaunchTarget.ATTR_CONNECTION_URI); String uri = toolChain.getProperty(IContainerLaunchTarget.ATTR_CONNECTION_URI);
if (connectionURI.equals(uri)) { if (connectionURI.equals(uri)) {
toolChainManager.removeToolChain(toolChain); toolChainManager.removeToolChain(toolChain);