diff options
author | Andrey Loskutov | 2018-05-03 18:36:02 +0000 |
---|---|---|
committer | Andrey Loskutov | 2018-05-03 18:56:32 +0000 |
commit | 7140afe557f9a04fc8e4e3b00e51a287e0b593ad (patch) | |
tree | 0cd66ba4cd054e1c55ea6009ff245fa762a544e4 | |
parent | c46fb77d882d80965ea28120c4fab547312e1080 (diff) | |
download | eclipse.platform.text-7140afe557f9a04fc8e4e3b00e51a287e0b593ad.tar.gz eclipse.platform.text-7140afe557f9a04fc8e4e3b00e51a287e0b593ad.tar.xz eclipse.platform.text-7140afe557f9a04fc8e4e3b00e51a287e0b593ad.zip |
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.java | 2 |
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 7c23a3108f3..2e97871451f 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 |