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

Bug 257517 - [project model] Incorrect handling of project delete delta

This commit is contained in:
Anton Leherbauer 2008-12-11 14:35:41 +00:00
parent f3558acfe4
commit 2b7f9a4f65
2 changed files with 9 additions and 4 deletions

View file

@ -478,8 +478,12 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
if (newContents != null) { if (newContents != null) {
ByteArrayOutputStream oldOut = write(oldEl); ByteArrayOutputStream oldOut = write(oldEl);
InputStream oldContents = new ByteArrayInputStream(oldOut.toByteArray()); InputStream oldContents = new ByteArrayInputStream(oldOut.toByteArray());
if(streamsMatch(newContents, oldContents)) try {
return null; if(streamsMatch(newContents, oldContents))
return null;
} finally {
newContents.close();
}
} }
} }
} catch (CoreException e){ } catch (CoreException e){

View file

@ -340,7 +340,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
if(!shouldVisit((IProject)projDelta.getResource())) if(!shouldVisit((IProject)projDelta.getResource()))
continue; continue;
if((projDelta.getFlags() & IResourceDelta.REMOVED) == IResourceDelta.REMOVED) if((projDelta.getKind() & IResourceDelta.REMOVED) == IResourceDelta.REMOVED)
continue; continue;
IResourceDelta children[] = projDelta.getAffectedChildren(); IResourceDelta children[] = projDelta.getAffectedChildren();
@ -354,9 +354,10 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
continue; continue;
//the .cproject file is changed //the .cproject file is changed
if((child.getFlags() & IResourceDelta.REMOVED) == IResourceDelta.REMOVED){ if((child.getKind() & IResourceDelta.REMOVED) == IResourceDelta.REMOVED){
//project file does not exist or corrupted, remove //project file does not exist or corrupted, remove
((RcMoveHandler)handler).setProjectDescription(rc.getProject(), null); ((RcMoveHandler)handler).setProjectDescription(rc.getProject(), null);
continue;
} }
try { try {