thecoop commented on PR #15134:
URL: https://github.com/apache/lucene/pull/15134#issuecomment-3241529546

   You mean `SortingStrategy`? `sortedFile` was being closed in all situations 
anyway, but this change makes it throw any exceptions regardless. This is ok 
because this is only used in 
[`hunspell.Dictionary`](https://github.com/apache/lucene/blob/ad24abfb0df055600f8a8d456ce3dfd7358542b2/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java#L269),
 which iterates through the EntrySorter 
[here](https://github.com/apache/lucene/blob/ad24abfb0df055600f8a8d456ce3dfd7358542b2/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java#L1120).
 
   
   That loop only exits normally once it gets to the end (returns `null`), all 
other possible exits of that loop are through exceptions. The exception will 
bubble up to the caller, where the `try` block will call `EntrySorter.close`. 
If _that_ throws an exception (which it didn't previously), it'll be added as 
suppressed to the original exception, so the original behaviour is maintained. 
The only difference is that an exception while closing the file will be added 
as suppressed, rather than being thrown away completely.


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