Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2015-03-17 10:57:52 +0000
committerDani Megert2015-03-17 10:57:52 +0000
commit8e77ba037585e316d24b11d18bf19c67d668141f (patch)
tree569881b4967ca491ed02179656952e9ce7da0ce0
parentaddaa58a5527f1f9d4d7ac61c6a1f734d106da39 (diff)
downloadeclipse.platform.text-I20150317-1130.tar.gz
eclipse.platform.text-I20150317-1130.tar.xz
eclipse.platform.text-I20150317-1130.zip
Fixed bug 448863: [Search] Refresh on Access ignored during text searchI20150317-2000I20150317-1130I20150317-0800
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java14
1 files changed, 11 insertions, 3 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 aa9f5f59a..ba75bfd67 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,8 @@ 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.IResourceStatus;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.filebuffers.FileBuffers;
import org.eclipse.core.filebuffers.ITextFileBuffer;
@@ -199,11 +201,15 @@ public class TextSearchVisitor {
private final MultiStatus fStatus;
+ private boolean fIsLightweightAutoRefresh;
+
public TextSearchVisitor(TextSearchRequestor collector, Pattern searchPattern) {
fCollector= collector;
fStatus= new MultiStatus(NewSearchUI.PLUGIN_ID, IStatus.OK, SearchMessages.TextSearchEngine_statusMessage, null);
fSearchPattern= searchPattern;
+
+ fIsLightweightAutoRefresh= Platform.getPreferencesService().getBoolean(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PREF_LIGHTWEIGHT_AUTO_REFRESH, false, null);
}
public IStatus search(IFile[] files, IProgressMonitor monitor) {
@@ -401,9 +407,11 @@ 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) {
- 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()) {
+ 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