Author: akazakov
Date: 2007-10-25 06:02:53 -0400 (Thu, 25 Oct 2007)
New Revision: 4503
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1168 Use file.isSynchronized(IResource.DEPTH_ZERO)
instead of try{}catch()
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2007-10-25
09:38:25 UTC (rev 4502)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2007-10-25
10:02:53 UTC (rev 4503)
@@ -18,6 +18,7 @@
import java.util.Set;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -124,10 +125,14 @@
String ext = file.getFileExtension();
String content = null;
try {
+ if(!file.isSynchronized(IResource.DEPTH_ZERO)) {
+ // The resource is out of sync with the file system
+ // Just ignore this resource.
+ return;
+ }
content = FileUtil.readStream(file.getContents());
} catch (CoreException e) {
- // It could be because of resource is out of sync with the file system
- // Just ignore this.
+ SeamCorePlugin.getPluginLog().logError(e);
return;
}
if(ext.equalsIgnoreCase("java")) { //$NON-NLS-1$