Skip to content

Commit

Permalink
Make query timeout members final in ExitableDirectoryReader (#12274)
Browse files Browse the repository at this point in the history
There's a couple of places in the Exitable wrapper classes where
queryTimeout is set within the constructor and never modified. This
commit makes such members final.
  • Loading branch information
javanna authored May 9, 2023
1 parent 1cd9c1d commit 10bad40
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
public class ExitableDirectoryReader extends FilterDirectoryReader {

private QueryTimeout queryTimeout;
private final QueryTimeout queryTimeout;

/** Exception that is thrown to prematurely terminate a term enumeration. */
@SuppressWarnings("serial")
Expand All @@ -50,7 +50,7 @@ public ExitingReaderException(String msg) {

/** Wrapper class for a SubReaderWrapper that is used by the ExitableDirectoryReader. */
public static class ExitableSubReaderWrapper extends SubReaderWrapper {
private QueryTimeout queryTimeout;
private final QueryTimeout queryTimeout;

/** Constructor * */
public ExitableSubReaderWrapper(QueryTimeout queryTimeout) {
Expand Down Expand Up @@ -810,7 +810,7 @@ public static class ExitableTermsEnum extends FilterTermsEnum {
// Create bit mask in the form of 0000 1111 for efficient checking
private static final int NUM_CALLS_PER_TIMEOUT_CHECK = (1 << 4) - 1; // 15
private int calls;
private QueryTimeout queryTimeout;
private final QueryTimeout queryTimeout;

/** Constructor * */
public ExitableTermsEnum(TermsEnum termsEnum, QueryTimeout queryTimeout) {
Expand Down

0 comments on commit 10bad40

Please sign in to comment.