mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 06:45:43 +02:00
bug 319512: Compilation warnings
This commit is contained in:
parent
ec89889177
commit
4d22104036
4 changed files with 18 additions and 21 deletions
|
@ -15,8 +15,7 @@ import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Map.Entry;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -29,7 +28,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
|
||||||
private final static Integer REMOVED_STATE = new Integer(REMOVED);
|
private final static Integer REMOVED_STATE = new Integer(REMOVED);
|
||||||
private final static Integer NONE_STATE = new Integer(0);
|
private final static Integer NONE_STATE = new Integer(0);
|
||||||
|
|
||||||
private Map fStateToPathListMap;
|
private HashMap<Integer, Set<String>> fStateToPathListMap;
|
||||||
private Properties fPathToStateProps;
|
private Properties fPathToStateProps;
|
||||||
private String fCfgId;
|
private String fCfgId;
|
||||||
private IProject fProject;
|
private IProject fProject;
|
||||||
|
@ -49,19 +48,18 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
|
||||||
if(fStateToPathListMap == null)
|
if(fStateToPathListMap == null)
|
||||||
return new IPath[0];
|
return new IPath[0];
|
||||||
|
|
||||||
Set set = (Set)fStateToPathListMap.get(new Integer(state));
|
Set<String> set = fStateToPathListMap.get(new Integer(state));
|
||||||
if(set == null)
|
if(set == null)
|
||||||
return new IPath[0];
|
return new IPath[0];
|
||||||
|
|
||||||
return setToFullPaths(set);
|
return setToFullPaths(set);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IPath[] setToFullPaths(Set set){
|
private IPath[] setToFullPaths(Set<String> set){
|
||||||
IPath paths[] = new IPath[set.size()];
|
IPath paths[] = new IPath[set.size()];
|
||||||
IPath path = fProject.getFullPath();
|
IPath path = fProject.getFullPath();
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for(Iterator iter = set.iterator(); iter.hasNext();){
|
for (String projRel : set) {
|
||||||
String projRel = (String)iter.next();
|
|
||||||
paths[num++] = path.append(projRel);
|
paths[num++] = path.append(projRel);
|
||||||
}
|
}
|
||||||
return paths;
|
return paths;
|
||||||
|
@ -88,7 +86,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
|
||||||
|
|
||||||
if(fPathToStateProps == null){
|
if(fPathToStateProps == null){
|
||||||
fPathToStateProps = new Properties();
|
fPathToStateProps = new Properties();
|
||||||
fStateToPathListMap = new HashMap();
|
fStateToPathListMap = new HashMap<Integer, Set<String>>();
|
||||||
}
|
}
|
||||||
String strState = stateToString(new Integer(state));
|
String strState = stateToString(new Integer(state));
|
||||||
Integer iState = stateToInt(strState);
|
Integer iState = stateToInt(strState);
|
||||||
|
@ -96,7 +94,7 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
|
|
||||||
if(cur != 0){
|
if(cur != 0){
|
||||||
Set set = (Set)fStateToPathListMap.get(new Integer(cur));
|
Set<String> set = fStateToPathListMap.get(new Integer(cur));
|
||||||
set.remove(str);
|
set.remove(str);
|
||||||
if(set.size() == 0)
|
if(set.size() == 0)
|
||||||
fStateToPathListMap.remove(iState);
|
fStateToPathListMap.remove(iState);
|
||||||
|
@ -104,9 +102,9 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
|
||||||
|
|
||||||
if(state != 0){
|
if(state != 0){
|
||||||
fPathToStateProps.setProperty(str, strState);
|
fPathToStateProps.setProperty(str, strState);
|
||||||
Set set = (Set)fStateToPathListMap.get(iState);
|
Set<String> set = fStateToPathListMap.get(iState);
|
||||||
if(set == null){
|
if(set == null){
|
||||||
set = new HashSet();
|
set = new HashSet<String>();
|
||||||
fStateToPathListMap.put(iState, set);
|
fStateToPathListMap.put(iState, set);
|
||||||
}
|
}
|
||||||
set.add(str);
|
set.add(str);
|
||||||
|
@ -126,16 +124,15 @@ public class ConfigurationBuildState implements IConfigurationBuildState {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void load(Properties props){
|
private void load(Properties props){
|
||||||
Map map = new HashMap();
|
HashMap<Integer, Set<String>> map = new HashMap<Integer, Set<String>>();
|
||||||
for(Iterator iter = props.entrySet().iterator(); iter.hasNext();){
|
for (@SuppressWarnings("rawtypes") Entry entry : props.entrySet()) {
|
||||||
Map.Entry entry = (Map.Entry)iter.next();
|
|
||||||
Integer i = stateToInt((String)entry.getValue());
|
Integer i = stateToInt((String)entry.getValue());
|
||||||
Set list = (Set)map.get(i);
|
Set<String> list = map.get(i);
|
||||||
if(list == null){
|
if(list == null){
|
||||||
list = new HashSet();
|
list = new HashSet<String>();
|
||||||
map.put(i, list);
|
map.put(i, list);
|
||||||
}
|
}
|
||||||
list.add(entry.getKey());
|
list.add((String)entry.getKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: trim lists
|
//TODO: trim lists
|
||||||
|
|
|
@ -120,7 +120,7 @@ public class DbgUtil {
|
||||||
IBuildIOType types[] = rc.getDependentIOTypes();
|
IBuildIOType types[] = rc.getDependentIOTypes();
|
||||||
|
|
||||||
if(types.length > 0){
|
if(types.length > 0){
|
||||||
Set set = new HashSet();
|
Set<IBuildStep> set = new HashSet<IBuildStep>();
|
||||||
|
|
||||||
for(int i = 0; i < types.length; i++){
|
for(int i = 0; i < types.length; i++){
|
||||||
if(set.add(types[i].getStep())){
|
if(set.add(types[i].getStep())){
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class DescriptionBuilder implements IBuildModelBuilder {
|
||||||
private IPath fCWD;
|
private IPath fCWD;
|
||||||
private boolean fBuildIncrementaly;
|
private boolean fBuildIncrementaly;
|
||||||
private boolean fResumeOnErrs;
|
private boolean fResumeOnErrs;
|
||||||
private Map fStepToStepBuilderMap = new HashMap();
|
private Map<IBuildStep, StepBuilder> fStepToStepBuilderMap = new HashMap<IBuildStep, StepBuilder>();
|
||||||
private int fNumCommands = -1;
|
private int fNumCommands = -1;
|
||||||
private GenDirInfo fDir;
|
private GenDirInfo fDir;
|
||||||
private IResourceRebuildStateContainer fRebuildStateContainer;
|
private IResourceRebuildStateContainer fRebuildStateContainer;
|
||||||
|
@ -195,7 +195,7 @@ public class DescriptionBuilder implements IBuildModelBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected StepBuilder getStepBuilder(IBuildStep step){
|
protected StepBuilder getStepBuilder(IBuildStep step){
|
||||||
StepBuilder b = (StepBuilder)fStepToStepBuilderMap.get(step);
|
StepBuilder b = fStepToStepBuilderMap.get(step);
|
||||||
if(b == null){
|
if(b == null){
|
||||||
b = new StepBuilder(step, fCWD, fResumeOnErrs, fDir, fRebuildStateContainer);
|
b = new StepBuilder(step, fCWD, fResumeOnErrs, fDir, fRebuildStateContainer);
|
||||||
fStepToStepBuilderMap.put(step, b);
|
fStepToStepBuilderMap.put(step, b);
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
public class GenDirInfo {
|
public class GenDirInfo {
|
||||||
private IProject fProject;
|
private IProject fProject;
|
||||||
private IPath fProjPath;
|
private IPath fProjPath;
|
||||||
private Set fDirPathSet = new HashSet();
|
private Set<IPath> fDirPathSet = new HashSet<IPath>();
|
||||||
|
|
||||||
public GenDirInfo(IProject proj){
|
public GenDirInfo(IProject proj){
|
||||||
fProject = proj;
|
fProject = proj;
|
||||||
|
|
Loading…
Add table
Reference in a new issue