Merge branch 'stable-2.12' into stable-2.13

* stable-2.12:
  Prevent limit of search outbounding max int value
  Fix NullPointerException on computing task name
  Double-check change data in cleaning up task

Change-Id: I60e321692b19b21f043aad3a59af9483b79a089e
This commit is contained in:
David Pursehouse
2016-09-01 09:59:56 +09:00
2 changed files with 16 additions and 0 deletions

View File

@@ -322,6 +322,9 @@ public class LuceneChangeIndex implements ChangeIndex {
IndexSearcher[] searchers = new IndexSearcher[indexes.size()];
try {
int realLimit = opts.start() + opts.limit();
if (Integer.MAX_VALUE - opts.limit() < opts.start()) {
realLimit = Integer.MAX_VALUE;
}
TopFieldDocs[] hits = new TopFieldDocs[indexes.size()];
for (int i = 0; i < indexes.size(); i++) {
searchers[i] = indexes.get(i).acquire();