You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2023/05/09 09:30:10 UTC
[lucene] 01/03: Make query timeout members final in ExitableDirectoryReader (#12274)
This is an automated email from the ASF dual-hosted git repository.
javanna pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git
commit 3e6ab76751888ffdd4f29db14ddcc6d67714f095
Author: Luca Cavanna <ja...@apache.org>
AuthorDate: Tue May 9 11:27:06 2023 +0200
Make query timeout members final in ExitableDirectoryReader (#12274)
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.
---
.../src/java/org/apache/lucene/index/ExitableDirectoryReader.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java b/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
index b180d3bdda3..a572b2258af 100644
--- a/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
@@ -36,7 +36,7 @@ import org.apache.lucene.util.automaton.CompiledAutomaton;
*/
public class ExitableDirectoryReader extends FilterDirectoryReader {
- private QueryTimeout queryTimeout;
+ private final QueryTimeout queryTimeout;
/** Exception that is thrown to prematurely terminate a term enumeration. */
@SuppressWarnings("serial")
@@ -50,7 +50,7 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
/** 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) {
@@ -810,7 +810,7 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
// 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) {