mikemccand commented on code in PR #16476:
URL: https://github.com/apache/lucene/pull/16476#discussion_r3711767422
##########
lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java:
##########
@@ -388,14 +389,25 @@ private static void parseSegmentInfos(
}
long totalDocs = 0;
-
+ SegmentInfo info;
Review Comment:
Could we move this inside the `for` loop, just above the new `try {`?
(Shrink-wrap the scoping)
##########
lucene/core/src/java/org/apache/lucene/index/CheckIndex.java:
##########
@@ -991,7 +1009,7 @@ private Status.SegmentInfoStatus testSegment(
final Version version = info.info.getVersion();
if (info.info.maxDoc() <= 0) {
- throw new CheckIndexException(" illegal number of documents: maxDoc=" +
info.info.maxDoc());
Review Comment:
Thank you for the clean-as-you-go.
##########
lucene/core/src/test/org/apache/lucene/index/TestTransactions.java:
##########
@@ -206,7 +206,10 @@ public void doWork() throws Throwable {
} catch (Exception e) {
// can be rethrown as RuntimeException if it happens during a close
listener
if (!e.getMessage().contains("on purpose")) {
- throw e;
+ // Caught "on-purpose" IOException can be rethrown as
CorruptSegmentInfoException
+ if (!(e instanceof CorruptSegmentInfoException)) {
Review Comment:
`== false`?
--
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]