mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Bug 228434 - Concurrent Modification Exception soon after loading
Eclipse in PerFileSICollector Change-Id: Ibcf6ae16cba60352dd5402915aee2624206a11c4 Reviewed-on: https://git.eclipse.org/r/11995 Reviewed-by: Andrew Gvozdev <angvoz.dev@gmail.com> IP-Clean: Andrew Gvozdev <angvoz.dev@gmail.com> Tested-by: Andrew Gvozdev <angvoz.dev@gmail.com>
This commit is contained in:
parent
6e5f32684a
commit
90b38099d4
5 changed files with 21 additions and 19 deletions
|
@ -14,11 +14,11 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.make.internal.core.scannerconfig.gnu;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||
import org.eclipse.cdt.internal.core.resources.ResourceLookup;
|
||||
|
@ -138,7 +138,7 @@ public class GCCPerFileBOPConsoleParser extends AbstractGCCBOPConsoleParser {
|
|||
}
|
||||
if (file != null) {
|
||||
CCommandDSC cmd = fUtil.getNewCCommandDSC(tokens, compilerInvocationIndex, extensionsIndex > 0);
|
||||
List<CCommandDSC> cmdList = new ArrayList<CCommandDSC>();
|
||||
List<CCommandDSC> cmdList = new CopyOnWriteArrayList<CCommandDSC>();
|
||||
cmdList.add(cmd);
|
||||
Map<ScannerInfoTypes, List<CCommandDSC>> sc = new HashMap<ScannerInfoTypes, List<CCommandDSC>>(1);
|
||||
sc.put(ScannerInfoTypes.COMPILER_COMMAND, cmdList);
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.make.internal.core.scannerconfig.gnu;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CCommandDSC;
|
||||
|
@ -58,7 +58,7 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
|||
String workingDir = getWorkingDirectory().toString();
|
||||
List<Map<String, List<String>>> directoryCommandList = directoryCommandListMap.get(workingDir);
|
||||
if (directoryCommandList == null) {
|
||||
directoryCommandList = new ArrayList<Map<String, List<String>>>();
|
||||
directoryCommandList = new CopyOnWriteArrayList<Map<String, List<String>>>();
|
||||
directoryCommandListMap.put(workingDir, directoryCommandList);
|
||||
++workingDirsN;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
|||
command21FileListMap = new HashMap<String, List<String>>(1);
|
||||
directoryCommandList.add(command21FileListMap);
|
||||
++commandsN;
|
||||
List<String> fileList = new ArrayList<String>();
|
||||
List<String> fileList = new CopyOnWriteArrayList<String>();
|
||||
command21FileListMap.put(genericCommand, fileList);
|
||||
fileList.add(longFileName);
|
||||
++filesN;
|
||||
|
@ -121,8 +121,8 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
|||
* @return CCommandDSC compile command description
|
||||
*/
|
||||
public CCommandDSC getNewCCommandDSC(String[] tokens, final int idxOfCompilerCommand, boolean cppFileType) {
|
||||
ArrayList<KVStringPair> dirafter = new ArrayList<KVStringPair>();
|
||||
ArrayList<String> includes = new ArrayList<String>();
|
||||
CopyOnWriteArrayList<KVStringPair> dirafter = new CopyOnWriteArrayList<KVStringPair>();
|
||||
CopyOnWriteArrayList<String> includes = new CopyOnWriteArrayList<String>();
|
||||
CCommandDSC command = new CCommandDSC(cppFileType, getProject());
|
||||
command.addSCOption(new KVStringPair(SCDOptionsEnum.COMMAND.toString(), tokens[idxOfCompilerCommand]));
|
||||
for (int i = idxOfCompilerCommand+1; i < tokens.length; ++i) {
|
||||
|
@ -161,7 +161,7 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
|||
KVStringPair pair = new KVStringPair(SCDOptionsEnum.IQUOTE.toString(), option);
|
||||
command.addSCOption(pair);
|
||||
}
|
||||
includes = new ArrayList<String>();
|
||||
includes = new CopyOnWriteArrayList<String>();
|
||||
// -I- has no parameter
|
||||
}
|
||||
else {
|
||||
|
@ -285,7 +285,7 @@ public class GCCPerFileBOPConsoleParserUtility extends AbstractGCCBOPConsolePars
|
|||
* @return List of CCommandDSC
|
||||
*/
|
||||
public List<CCommandDSC> getCCommandDSCList() {
|
||||
return new ArrayList<CCommandDSC>(commandsList2);
|
||||
return new CopyOnWriteArrayList<CCommandDSC>(commandsList2);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.make.internal.core.scannerconfig.gnu;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector;
|
||||
|
@ -68,9 +68,9 @@ public class GCCScannerInfoConsoleParser extends AbstractGCCBOPConsoleParser {
|
|||
}
|
||||
|
||||
// Recognized gcc or g++ compiler invocation
|
||||
List<String> includes = new ArrayList<String>();
|
||||
List<String> symbols = new ArrayList<String>();
|
||||
List<String> targetSpecificOptions = new ArrayList<String>();
|
||||
List<String> includes = new CopyOnWriteArrayList<String>();
|
||||
List<String> symbols = new CopyOnWriteArrayList<String>();
|
||||
List<String> targetSpecificOptions = new CopyOnWriteArrayList<String>();
|
||||
|
||||
String fileName = null;
|
||||
for (int j= compilerInvocationIdx+1; j < tokens.length; j++) {
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.make.xlc.core.scannerconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
|
||||
|
@ -28,6 +28,7 @@ import org.eclipse.core.runtime.IPath;
|
|||
* @author crecoskie
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("restriction")
|
||||
public class XLCPerFileBuildOutputParser extends AbstractXLCBuildOutputParser {
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -127,7 +128,7 @@ public class XLCPerFileBuildOutputParser extends AbstractXLCBuildOutputParser {
|
|||
}
|
||||
if (true /*file != null*/) {
|
||||
CCommandDSC cmd = getUtility().getNewCCommandDSC(tokens, compilerInvocationIndex, extensionsIndex > 0);
|
||||
List<CCommandDSC> cmdList = new ArrayList<CCommandDSC>();
|
||||
List<CCommandDSC> cmdList = new CopyOnWriteArrayList<CCommandDSC>();
|
||||
cmdList.add(cmd);
|
||||
Map<ScannerInfoTypes, List<CCommandDSC>> sc = new HashMap<ScannerInfoTypes, List<CCommandDSC>>(1);
|
||||
sc.put(ScannerInfoTypes.COMPILER_COMMAND, cmdList);
|
||||
|
|
|
@ -10,10 +10,11 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.make.xlc.core.scannerconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector2;
|
||||
|
@ -47,9 +48,9 @@ public class XLCPerProjectBuildOutputParser extends
|
|||
}
|
||||
|
||||
// Recognized gcc or g++ compiler invocation
|
||||
List<String> includes = new ArrayList<String>();
|
||||
List<String> symbols = new ArrayList<String>();
|
||||
List<String> targetSpecificOptions = new ArrayList<String>();
|
||||
List<String> includes = new CopyOnWriteArrayList<String>();
|
||||
List<String> symbols = new CopyOnWriteArrayList<String>();
|
||||
List<String> targetSpecificOptions = new CopyOnWriteArrayList<String>();
|
||||
|
||||
String fileName = null;
|
||||
for (int j= compilerInvocationIdx+1; j < tokens.length; j++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue