Author: scabanovich
Date: 2007-10-10 09:02:31 -0400 (Wed, 10 Oct 2007)
New Revision: 4093
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java
Log:
JBIDE-1055
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java 2007-10-10
12:58:20 UTC (rev 4092)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FolderImpl.java 2007-10-10
13:02:31 UTC (rev 4093)
@@ -13,11 +13,13 @@
import java.io.File;
import java.util.*;
+import org.eclipse.core.internal.resources.ResourceException;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.jboss.tools.common.model.markers.ResourceMarkers;
import org.jboss.tools.common.model.plugin.ModelPlugin;
@@ -220,19 +222,32 @@
updateLock++;
Map<String,File> mf = new HashMap<String,File>();
linked.clear();
+ XModelObject fileSystem = getFileSystem();
+ if(fileSystem == null) return false;
+ FileSystemsImpl fsi = (FileSystemsImpl)fileSystem.getParent();
try {
- FileSystemsImpl fsi = (FileSystemsImpl)getFileSystem().getParent();
if(resource != null && resource.exists() &&
!resource.isSynchronized(IResource.DEPTH_ONE)) try {
fsi.lockUpdate();
resource.refreshLocal(IResource.DEPTH_ZERO, null);
- IResource[] rs = resource.members();
- for (int i = 0; i < rs.length; i++) {
- if(!rs[i].isSynchronized(IResource.DEPTH_ZERO)) {
- if(unsynchronized == null) unsynchronized = new HashSet<String>();
- unsynchronized.add(rs[i].getName().toLowerCase());
+ if(resource.exists()) {
+ IResource[] rs = resource.members();
+ for (int i = 0; i < rs.length; i++) {
+ if(!rs[i].isSynchronized(IResource.DEPTH_ZERO)) {
+ if(unsynchronized == null) unsynchronized = new HashSet<String>();
+ unsynchronized.add(rs[i].getName().toLowerCase());
+ }
}
+ if(resource.exists()) {
+ resource.refreshLocal(IResource.DEPTH_ONE, null);
+ }
}
- resource.refreshLocal(IResource.DEPTH_ONE, null);
+ } catch (ResourceException re) {
+ IPath p = resource.getLocation();
+ if(p != null && p.toFile().exists()) {
+ ModelPlugin.getPluginLog().logError("Exception caught in
FolderImpl.update()", re);
+ } else {
+ //ignore we cannot prevent this when project is removed externally
+ }
} catch (Exception e) {
ModelPlugin.getPluginLog().logError("Exception caught in
FolderImpl.update()",e);
} finally {
Show replies by date