uschindler commented on PR #15823:
URL: https://github.com/apache/lucene/pull/15823#issuecomment-4140584400

   Looks good. To prevent an ArrayIndexOutOfBounds we could also apply a 
`.limit(remaining)` to the stream passed to `addAll` and possibly change the 
Java docs to state that at most something like `maxSize - size` are consumed 
from stream. 
   
   Alternatively maybe add a test for the new method to verify heap keeps 
intact when adding too many elements. Maybe add a try/catch around the stream 
consumer to transform the exception to something more meaningful with a good 
error message.
   
   I will have a close look later.


-- 
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