jainankitk commented on code in PR #15897:
URL: https://github.com/apache/lucene/pull/15897#discussion_r3048389875


##########
lucene/grouping/src/test/org/apache/lucene/search/grouping/BaseGroupSelectorTestCase.java:
##########
@@ -330,16 +330,12 @@ public void testShardedGrouping() throws IOException {
     TopGroups<T> singletonTopGroups =
         control.getIndexSearcher().search(topLevel, topGroupsCollectorManager);
 
-    // TODO why does SearchGroup.merge() take a list but TopGroups.merge() 
take an array?
-    @SuppressWarnings("unchecked")
-    TopGroups<T>[] shardTopGroups = (TopGroups<T>[]) new 
TopGroups<?>[shards.length];
-    int j = 0;
+    List<TopGroups<T>> shardTopGroups = new ArrayList<>();

Review Comment:
   nit: can we initialize the `ArrayList` with `shards.length` to avoid 
extending the backing array?



##########
lucene/grouping/src/test/org/apache/lucene/search/grouping/TestGrouping.java:
##########
@@ -1528,8 +1528,7 @@ private TopGroups<BytesRef> searchShards(
 
     if (mergedTopGroups != null) {
       // Now 2nd pass:
-      @SuppressWarnings({"unchecked", "rawtypes"})
-      final TopGroups<BytesRef>[] shardTopGroups = new 
TopGroups[subSearchers.length];
+      final List<TopGroups<BytesRef>> shardTopGroups = new ArrayList<>();

Review Comment:
   nit: same here with `subSearchers.length`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to