jpountz commented on a change in pull request #520:
URL: https://github.com/apache/lucene/pull/520#discussion_r763049319



##########
File path: lucene/CHANGES.txt
##########
@@ -100,6 +100,8 @@ Other
 
 * LUCENE-10284: Upgrade morfologik-stemming to 2.1.8. (Dawid Weiss)
 
+LUCENE-10289: DocIdSetBuilder#grow() takes now a long instead of an int. 
(Ignacio Vera)

Review comment:
       ```suggestion
    * LUCENE-10289: DocIdSetBuilder#grow() takes now a long instead of an int. 
(Ignacio Vera)
   ```

##########
File path: lucene/core/src/java/org/apache/lucene/util/DocIdSetBuilder.java
##########
@@ -184,10 +184,11 @@ public void add(DocIdSetIterator iter) throws IOException 
{
    * Reserve space and return a {@link BulkAdder} object that can be used to 
add up to {@code
    * numDocs} documents.
    */
-  public BulkAdder grow(int numDocs) {
+  public BulkAdder grow(long numDocs) {
     if (bitSet == null) {
       if ((long) totalAllocated + numDocs <= threshold) {
-        ensureBufferCapacity(numDocs);
+        // threshold is an int, cast is safe
+        ensureBufferCapacity((int) numDocs);

Review comment:
       can you still use `Math.toIntExact` instead for safety?

##########
File path: lucene/CHANGES.txt
##########
@@ -100,6 +100,8 @@ Other
 
 * LUCENE-10284: Upgrade morfologik-stemming to 2.1.8. (Dawid Weiss)
 
+LUCENE-10289: DocIdSetBuilder#grow() takes now a long instead of an int. 
(Ignacio Vera)

Review comment:
       Also, move the CHANGES entry under `API changes`?




-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to