1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Bug 407591 - UnsupportedOperationException thrown in

GCCScannerInfoConsoleParser.processCommand()

Change-Id: I786b20fb80a4353a23caf6450569f8b9d8b4a752
Reviewed-on: https://git.eclipse.org/r/12719
Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
IP-Clean: Jeff Johnston <jjohnstn@redhat.com>
Tested-by: Jeff Johnston <jjohnstn@redhat.com>
This commit is contained in:
Chris Recoskie 2013-05-10 15:06:47 -04:00 committed by Jeff Johnston
parent 2325a5eccb
commit 2b184dc63a

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.make.internal.core.scannerconfig.gnu;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
@ -167,7 +168,8 @@ public class GCCScannerInfoConsoleParser extends AbstractGCCBOPConsoleParser {
IProject project = getProject();
IFile file = null;
List<String> translatedIncludes = includes;
List<String> translatedIncludes = new LinkedList<String>();
translatedIncludes.addAll(includes);
if (includes.size() > 0) {
if (fUtil != null) {
file = fUtil.findFile(fileName);
@ -188,16 +190,19 @@ public class GCCScannerInfoConsoleParser extends AbstractGCCBOPConsoleParser {
}
}
}
CopyOnWriteArrayList<String> translatedIncludesToPut = new CopyOnWriteArrayList<String>(translatedIncludes);
// Contribute discovered includes and symbols to the ScannerInfoCollector
if (translatedIncludes.size() > 0 || symbols.size() > 0) {
if (translatedIncludesToPut.size() > 0 || symbols.size() > 0) {
Map<ScannerInfoTypes, List<String>> scannerInfo = new HashMap<ScannerInfoTypes, List<String>>();
scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, translatedIncludes);
scannerInfo.put(ScannerInfoTypes.INCLUDE_PATHS, translatedIncludesToPut);
scannerInfo.put(ScannerInfoTypes.SYMBOL_DEFINITIONS, symbols);
scannerInfo.put(ScannerInfoTypes.TARGET_SPECIFIC_OPTION, targetSpecificOptions);
getCollector().contributeToScannerConfig(project, scannerInfo);
TraceUtil.outputTrace("Discovered scanner info for file \'" + fileName + '\'', //$NON-NLS-1$
"Include paths", includes, translatedIncludes, "Defined symbols", symbols); //$NON-NLS-1$ //$NON-NLS-2$
"Include paths", includes, translatedIncludesToPut, "Defined symbols", symbols); //$NON-NLS-1$ //$NON-NLS-2$
}
return true;
}