summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2018-05-03 14:36:02 -0400
committerAndrey Loskutov2018-05-03 14:56:32 -0400
commit7140afe557f9a04fc8e4e3b00e51a287e0b593ad (patch)
tree0cd66ba4cd054e1c55ea6009ff245fa762a544e4
parentc46fb77d882d80965ea28120c4fab547312e1080 (diff)
downloadeclipse.platform.text-7140afe557f9a04fc8e4e3b00e51a287e0b593ad.zip
eclipse.platform.text-7140afe557f9a04fc8e4e3b00e51a287e0b593ad.tar.gz
eclipse.platform.text-7140afe557f9a04fc8e4e3b00e51a287e0b593ad.tar.xz
Bug 534324 - Search never stops on high file countsI20180503-2000
Fixed calculation of filesPerJob to schedule >= jobs as jobCount specified for the job group. This ensures that the jobGroup.join() returns (and does not wait on a job that is never scheduled). Change-Id: Id78d5e096928f480b6563c4817f645c9f0a6b50c Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/core/text/TextSearchVisitor.java2
1 files changed, 1 insertions, 1 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 7c23a31..2e97871 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
@@ -379,7 +379,7 @@ public class TextSearchVisitor {
try {
fCollector.beginReporting();
Map<IFile, IDocument> documentsInEditors= PlatformUI.isWorkbenchRunning() ? evalNonFileBufferDocuments() : Collections.emptyMap();
- int filesPerJob= (files.length + jobCount - 1) / jobCount;
+ int filesPerJob = Math.max(1, files.length / jobCount);
IFile[] filesByLocation= new IFile[files.length];
System.arraycopy(files, 0, filesByLocation, 0, files.length);
// Sorting files to search by location allows to more easily reuse