From 2b3e0665182ea74a5a1a1b537cfb2dd7c4dbc35a Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Sat, 14 May 2011 11:25:56 +0000 Subject: [PATCH] LUCENE-1421: add workaround to unbreak the build git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1103048 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/search/grouping/FirstPassGroupingCollector.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/grouping/src/java/org/apache/lucene/search/grouping/FirstPassGroupingCollector.java b/modules/grouping/src/java/org/apache/lucene/search/grouping/FirstPassGroupingCollector.java index 1b2718980aa..a1cf29410f2 100644 --- a/modules/grouping/src/java/org/apache/lucene/search/grouping/FirstPassGroupingCollector.java +++ b/modules/grouping/src/java/org/apache/lucene/search/grouping/FirstPassGroupingCollector.java @@ -229,7 +229,9 @@ public class FirstPassGroupingCollector extends Collector { // We already tested that the document is competitive, so replace // the bottom group with this new group. - final CollectedSearchGroup bottomGroup = orderedGroups.pollLast(); + // java 6-only: final CollectedSearchGroup bottomGroup = orderedGroups.pollLast(); + final CollectedSearchGroup bottomGroup = orderedGroups.last(); + orderedGroups.remove(bottomGroup); assert orderedGroups.size() == topNGroups -1; groupMap.remove(bottomGroup.groupValue);