Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-01-30 21:36:40 +0000
committerJean Michel-Lemieux2002-01-30 21:36:40 +0000
commitc94aff278e954f2dfdf671910bfada268ad6da1d (patch)
tree24f4ff262def052628d9f913dec5391b1d7a87b1
parent7448430047d17de9f55e397c217fd889b88e5abc (diff)
downloadeclipse.platform.team-c94aff278e954f2dfdf671910bfada268ad6da1d.tar.gz
eclipse.platform.team-c94aff278e954f2dfdf671910bfada268ad6da1d.tar.xz
eclipse.platform.team-c94aff278e954f2dfdf671910bfada268ad6da1d.zip
Bug if phantom resources are changed or a resource doesn't exist on disk.
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java42
1 files changed, 28 insertions, 14 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java
index 51ab65ea3..fdcafdd70 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/syncinfo/FileSystemSynchronizer.java
@@ -15,6 +15,7 @@ import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
@@ -137,13 +138,18 @@ public class FileSystemSynchronizer implements ICVSSynchronizer {
protected void handleRemoved(IResource[] resources) {
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
- File file = resource.getLocation().toFile();
- // if a resource is deleted, then clear the cache, there is not need for a delta.
- if(!SyncFileUtil.isMetaFile(file)) {
- clearCache(file, IResource.DEPTH_INFINITE);
- } else {
- if(resource.getName().equals("CVS")) {
- handleMetaChange(file, resource);
+ if(resource!=null) {
+ IPath location = resource.getLocation();
+ if(location!=null) {
+ File file = resource.getLocation().toFile();
+ // if a resource is deleted, then clear the cache, there is not need for a delta.
+ if(!SyncFileUtil.isMetaFile(file)) {
+ clearCache(file, IResource.DEPTH_INFINITE);
+ } else {
+ if(resource.getName().equals("CVS")) {
+ handleMetaChange(file, resource);
+ }
+ }
}
}
}
@@ -188,13 +194,21 @@ public class FileSystemSynchronizer implements ICVSSynchronizer {
*/
private void handleDefault(IResource[] resources) {
for (int i = 0; i < resources.length; i++) {
- File file = resources[i].getLocation().toFile();
- if(SyncFileUtil.isMetaFile(file)) {
- handleMetaChange(file.getParentFile(), resources[i].getParent());
- // add all parents children to delta
- } else {
- if(!file.getName().equals("CVS")) {
- delta.add(resources[i]);
+ // it's seems that sometimes the resources in the array are null.
+ IResource resource = resources[i];
+ if(resource!=null) {
+ IPath location = resource.getLocation();
+ // if the resource does not exist on disk, ignore it.
+ if(location!=null) {
+ File file = location.toFile();
+ if(SyncFileUtil.isMetaFile(file)) {
+ handleMetaChange(file.getParentFile(), resources[i].getParent());
+ // add all parents children to delta
+ } else {
+ if(!file.getName().equals("CVS")) {
+ delta.add(resources[i]);
+ }
+ }
}
}
}

Back to the top