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

RESOLVED - bug 230161: "clean selected files" causes NullPointer exception

https://bugs.eclipse.org/bugs/show_bug.cgi?id=230161
This commit is contained in:
Chris Recoskie 2008-06-04 01:31:02 +00:00
parent bed0175101
commit 92de3f94c0

View file

@ -1633,43 +1633,46 @@ public class GeneratedMakefileBuilder extends ACBuilder {
IBuildResource buildResource = des.getBuildResource(file);
// step collector
Set dependentSteps = new HashSet();
if (buildResource != null) {
// get dependent IO types
IBuildIOType depTypes[] = buildResource.getDependentIOTypes();
// step collector
Set dependentSteps = new HashSet();
// iterate through each type and add the step the type belongs to to
// the collector
for (int j = 0; j < depTypes.length; j++) {
IBuildIOType type = depTypes[j];
if (type != null && type.getStep() != null)
dependentSteps.add(type.getStep());
}
// get dependent IO types
IBuildIOType depTypes[] = buildResource.getDependentIOTypes();
// iterate through all build steps
Iterator stepIter = dependentSteps.iterator();
while (stepIter.hasNext()) {
IBuildStep step = (IBuildStep) stepIter.next();
// Delete the output resources
IBuildIOType[] outputIOTypes = step.getOutputIOTypes();
for (int j = 0; j < outputIOTypes.length; j++) {
IBuildResource[] resources = outputIOTypes[j]
.getResources();
for (int i = 0; i < resources.length; i++) {
IResource outputFile = currentProject
.findMember(resources[i].getFullPath().removeFirstSegments(1)); // strip project name
if (outputFile != null)
outputFile.delete(true, new SubProgressMonitor(
monitor, 1));
}
// iterate through each type and add the step the type belongs
// to to
// the collector
for (int j = 0; j < depTypes.length; j++) {
IBuildIOType type = depTypes[j];
if (type != null && type.getStep() != null)
dependentSteps.add(type.getStep());
}
// iterate through all build steps
Iterator stepIter = dependentSteps.iterator();
while (stepIter.hasNext()) {
IBuildStep step = (IBuildStep) stepIter.next();
// Delete the output resources
IBuildIOType[] outputIOTypes = step.getOutputIOTypes();
for (int j = 0; j < outputIOTypes.length; j++) {
IBuildResource[] resources = outputIOTypes[j].getResources();
for (int i = 0; i < resources.length; i++) {
IResource outputFile = currentProject.findMember(resources[i]
.getFullPath().removeFirstSegments(1)); // strip project name
if (outputFile != null)
outputFile.delete(true, new SubProgressMonitor(monitor, 1));
}
}
}
}
} catch (CoreException e) {