1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

1. Error parser settings fixes

2. Ensure ther eis only one instance of CProjectDescriptionManager
3. Fix ArrayStoreException External Extension Build Macro  Supplier
This commit is contained in:
Mikhail Sennikovsky 2007-05-15 10:48:29 +00:00
parent 25fe0e8d83
commit 3e5b00fc98
9 changed files with 56 additions and 39 deletions

View file

@ -2326,12 +2326,14 @@ public class Builder extends BuildObject implements IBuilder, IMatchKeyProvider
}
public Set contributeErrorParsers(Set set){
if(set == null)
set = new HashSet();
String ids[] = getErrorParserList();
if(ids.length != 0)
set.addAll(Arrays.asList(ids));
if(getErrorParserIds() != null){
if(set == null)
set = new HashSet();
String ids[] = getErrorParserList();
if(ids.length != 0)
set.addAll(Arrays.asList(ids));
}
return set;
}

View file

@ -23,6 +23,7 @@ import java.util.Vector;
import org.eclipse.cdt.build.core.scannerconfig.ICfgScannerConfigBuilderInfo2Set;
import org.eclipse.cdt.build.internal.core.scannerconfig.CfgDiscoveredPathManager.PathInfoCache;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
import org.eclipse.cdt.core.settings.model.CLibraryPathEntry;
import org.eclipse.cdt.core.settings.model.CSourceEntry;
@ -1410,19 +1411,24 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
// }
// return errorParsers;
Set set = contributeErrorParsers(null, true);
String result[] = new String[set.size()];
set.toArray(result);
return result;
if(set != null){
String result[] = new String[set.size()];
set.toArray(result);
return result;
}
return CCorePlugin.getDefault().getAllErrorParsersIDs();
}
public Set contributeErrorParsers(Set set, boolean includeChildren) {
String parserIDs = getErrorParserIdsAttribute();
if(set == null)
set = new HashSet();
if (parserIDs != null && parserIDs.length() != 0) {
StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$
while (tok.hasMoreElements()) {
set.add(tok.nextToken());
if (parserIDs != null){
if(set == null)
set = new HashSet();
if(parserIDs.length() != 0) {
StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$
while (tok.hasMoreElements()) {
set.add(tok.nextToken());
}
}
}
@ -1430,7 +1436,7 @@ public class Configuration extends BuildObject implements IConfiguration, IBuild
IResourceInfo[] rcInfos = getResourceInfos();
for(int i = 0; i < rcInfos.length; i++){
ResourceInfo rcInfo = (ResourceInfo)rcInfos[i];
rcInfo.contributeErrorParsers(set);
set = rcInfo.contributeErrorParsers(set);
}
}
return set;

View file

@ -1440,11 +1440,11 @@ public class FolderInfo extends ResourceInfo implements IFolderInfo {
}
public Set contributeErrorParsers(Set set){
if(set == null)
set = new HashSet();
// if(set == null)
// set = new HashSet();
if(toolChain != null)
toolChain.contributeErrorParsers(this, set, true);
set = toolChain.contributeErrorParsers(this, set, true);
return set;
}

View file

@ -469,11 +469,11 @@ public abstract class ResourceInfo extends BuildObject implements IResourceInfo
public abstract Set contributeErrorParsers(Set set);
protected Set contributeErrorParsers(ITool[] tools, Set set){
if(set == null)
set = new HashSet();
// if(set == null)
// set = new HashSet();
for(int i = 0; i < tools.length; i++){
Tool tool = (Tool)tools[i];
tool.contributeErrorParsers(set);
set = tool.contributeErrorParsers(set);
}
return set;
}

View file

@ -1717,12 +1717,13 @@ public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatch
}
public Set contributeErrorParsers(Set set){
if(set == null)
set = new HashSet();
String ids[] = getErrorParserList();
if(ids.length != 0)
set.addAll(Arrays.asList(ids));
if(getErrorParserIds() != null){
if(set == null)
set = new HashSet();
String ids[] = getErrorParserList();
if(ids.length != 0)
set.addAll(Arrays.asList(ids));
}
return set;
}

View file

@ -1377,24 +1377,25 @@ public class ToolChain extends HoldsOptions implements IToolChain, IBuildPropert
}
public Set contributeErrorParsers(FolderInfo info, Set set, boolean includeChildren){
if(set == null)
set = new HashSet();
String parserIDs = getErrorParserIdsAttribute();
if (parserIDs != null && parserIDs.length() != 0) {
StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$
while (tok.hasMoreElements()) {
set.add(tok.nextToken());
if (parserIDs != null){
if(set == null)
set = new HashSet();
if(parserIDs.length() != 0) {
StringTokenizer tok = new StringTokenizer(parserIDs, ";"); //$NON-NLS-1$
while (tok.hasMoreElements()) {
set.add(tok.nextToken());
}
}
}
if(includeChildren){
ITool tools[] = info.getFilteredTools();
info.contributeErrorParsers(tools, set);
set = info.contributeErrorParsers(tools, set);
if(info.isRoot()){
Builder builder = (Builder)getBuilder();
builder.contributeErrorParsers(set);
set = builder.contributeErrorParsers(set);
}
}
return set;

View file

@ -215,7 +215,7 @@ public class ExternalExtensionMacroSupplier implements ICdtVariableSupplier{
if(macros == null || macros.length == 0)
return macros;
ICdtVariable filtered[] = new IBuildMacro[macros.length];
ICdtVariable filtered[] = new ICdtVariable[macros.length];
int filteredNum = 0;
for(int i = 0; i < macros.length; i++){
ICdtVariable var = macros[i];

View file

@ -281,11 +281,18 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
}
public static CProjectDescriptionManager getInstance(){
if(fInstance == null)
fInstance = getInstanceSynch();
return fInstance;
}
private static synchronized CProjectDescriptionManager getInstanceSynch(){
if(fInstance == null)
fInstance = new CProjectDescriptionManager();
return fInstance;
}
public void registerResourceListener() {
assert fRcChangeHandler == null;
fRcChangeHandler = new ResourceChangeHandler();

View file

@ -304,7 +304,7 @@ public class CConfigBasedDescriptor implements ICDescriptor {
}
public void saveProjectData() throws CoreException {
if(CConfigBasedDescriptorManager.getInstance().reconsile(this, fCfgDes.getProjectDescription()))
if(CProjectDescriptionManager.getInstance().getDescriptorManager().reconsile(this, fCfgDes.getProjectDescription()))
fIsDirty = true;
checkApply();