Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-07-28 15:34:59 +0000
committerChristian W. Damus2015-07-28 18:29:27 +0000
commit82bcb214bc5803f425dd24fa23f50c76378ef05a (patch)
tree29a59ac58b00ff5cb1b0cf1248cd27a37e84c856 /plugins/infra/emf
parenteaf62bc725a26dab3dedef991a609b19c8ac0ba7 (diff)
downloadorg.eclipse.papyrus-82bcb214bc5803f425dd24fa23f50c76378ef05a.tar.gz
org.eclipse.papyrus-82bcb214bc5803f425dd24fa23f50c76378ef05a.tar.xz
org.eclipse.papyrus-82bcb214bc5803f425dd24fa23f50c76378ef05a.zip
Bug 473154: FileNotFoundException in LocalFile.openInputStream (369)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=473154 Ensure that we only attempt to index files that are synchronized as far as the workspace is concerned. Includes a JUnit test that fails without the fix on detection of the same exception logged as in the original bug report. (cherry picked from commit e334737bc2fe21da7ab91bfc87fcd49944275bdd) Change-Id: Idf211d87b7c59cea73d399419e8dcabede66dde8
Diffstat (limited to 'plugins/infra/emf')
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java
index 8a5ace5abb3..45e6ba795b6 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java
@@ -284,8 +284,13 @@ public class WorkspaceModelIndex<T> {
boolean match(IFile file) {
boolean result = false;
- // Don't even attempt to match the content type if the file extension doesn't match
- if (file.isAccessible() && ((fileExtensions == null) || fileExtensions.contains(file.getFileExtension()))) {
+ // Don't even attempt to match the content type if the file extension doesn't match.
+ // And if it's not synchronized, don't attempt to do anything with it. We'll get it
+ // later when it is synchronized
+ if (file.isAccessible()
+ && ((fileExtensions == null) || fileExtensions.contains(file.getFileExtension()))
+ && file.isSynchronized(IResource.DEPTH_ZERO)) {
+
IContentType[] contentTypes = contentTypeService.getContentTypes(file);
if (contentTypes != null) {
for (int i = 0; (i < contentTypes.length) && !result; i++) {

Back to the top