From b6100d978711419fad8ca4970618b9f3ceee8620 Mon Sep 17 00:00:00 2001 From: Luca Cavanna Date: Tue, 9 May 2023 11:28:23 +0200 Subject: [PATCH] Make TimeExceededException members final (#12271) TimeExceededException has three members that are set within its constructor and never modified. They can be made final. --- .../org/apache/lucene/search/TimeLimitingCollector.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/search/TimeLimitingCollector.java b/lucene/core/src/java/org/apache/lucene/search/TimeLimitingCollector.java index 4a208a3f0c5..c50f3a372e9 100644 --- a/lucene/core/src/java/org/apache/lucene/search/TimeLimitingCollector.java +++ b/lucene/core/src/java/org/apache/lucene/search/TimeLimitingCollector.java @@ -33,9 +33,9 @@ public class TimeLimitingCollector implements Collector { /** Thrown when elapsed search time exceeds allowed search time. */ @SuppressWarnings("serial") public static class TimeExceededException extends RuntimeException { - private long timeAllowed; - private long timeElapsed; - private int lastDocCollected; + private final long timeAllowed; + private final long timeElapsed; + private final int lastDocCollected; private TimeExceededException(long timeAllowed, long timeElapsed, int lastDocCollected) { super(