Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2015-03-18 08:56:37 +0000
committerDani Megert2015-03-18 08:56:37 +0000
commit90c35fbcc356742bd8fb4a7b3da0422ec98dfb95 (patch)
treea73ec0c70170a25bb345d143bc31d7661f5438fb
parent8e77ba037585e316d24b11d18bf19c67d668141f (diff)
downloadeclipse.platform.text-90c35fbcc356742bd8fb4a7b3da0422ec98dfb95.tar.gz
eclipse.platform.text-90c35fbcc356742bd8fb4a7b3da0422ec98dfb95.tar.xz
eclipse.platform.text-90c35fbcc356742bd8fb4a7b3da0422ec98dfb95.zip
Fixed bug 448863 (part 2): [Search] Refresh on Access ignored during text searchI20150318-0800
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
index ba75bfd67cc..1747e4c4df3 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java
@@ -36,6 +36,7 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobGroup;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceStatus;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -407,11 +408,19 @@ public class TextSearchVisitor {
String message= Messages.format(SearchMessages.TextSearchVisitor_error, args);
return new Status(IStatus.ERROR, NewSearchUI.PLUGIN_ID, IStatus.ERROR, message, e);
} catch (CoreException e) {
- if (!fIsLightweightAutoRefresh || IResourceStatus.FAILED_READ_LOCAL != e.getStatus().getCode()) {
- String[] args= { getExceptionMessage(e), file.getFullPath().makeRelative().toString() };
- String message= Messages.format(SearchMessages.TextSearchVisitor_error, args);
- return new Status(IStatus.ERROR, NewSearchUI.PLUGIN_ID, IStatus.ERROR, message, e);
+ if (fIsLightweightAutoRefresh && IResourceStatus.FAILED_READ_LOCAL == e.getStatus().getCode()) {
+ // Check if read failed because the file no longer exists
+ try {
+ file.refreshLocal(IResource.DEPTH_ZERO, monitor);
+ if (!file.exists())
+ return monitor.isCanceled() ? Status.CANCEL_STATUS : Status.OK_STATUS;
+ } catch (CoreException ex) {
+ // Report original CoreException
+ }
}
+ String[] args= { getExceptionMessage(e), file.getFullPath().makeRelative().toString() };
+ String message= Messages.format(SearchMessages.TextSearchVisitor_error, args);
+ return new Status(IStatus.ERROR, NewSearchUI.PLUGIN_ID, IStatus.ERROR, message, e);
} catch (StackOverflowError e) {
// Trigger cancellation of remaining jobs in the group.
// An alternative is to move this method into TextSearchJob and call getJobGroup().cancel() directly.

Back to the top