You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2026/05/01 21:24:51 UTC

(solr) branch main updated: SOLR-17951: satiate errorprone's ImmutableEnumChecker

This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 073d82d22d0 SOLR-17951: satiate errorprone's ImmutableEnumChecker
073d82d22d0 is described below

commit 073d82d22d09a42929c7260836a93f4896646090
Author: Chris Hostetter <ho...@apache.org>
AuthorDate: Fri May 1 14:24:40 2026 -0700

    SOLR-17951: satiate errorprone's ImmutableEnumChecker
---
 solr/core/src/java/org/apache/solr/search/ReRankOperator.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/solr/core/src/java/org/apache/solr/search/ReRankOperator.java b/solr/core/src/java/org/apache/solr/search/ReRankOperator.java
index b3b5582836c..9072a18e25e 100644
--- a/solr/core/src/java/org/apache/solr/search/ReRankOperator.java
+++ b/solr/core/src/java/org/apache/solr/search/ReRankOperator.java
@@ -25,6 +25,12 @@ public enum ReRankOperator implements DoubleBinaryOperator {
   MULTIPLY((firstPass, secondPass) -> firstPass * secondPass),
   REPLACE((firstPass, secondPass) -> secondPass);
 
+  /**
+   * The operators we use <em>are</em> immutable, even if we can't annotate them as such, and
+   * errorprone's "TIP" of using abstract methods would make this enum declaration 5 times longer --
+   * so no thanks.
+   */
+  @SuppressWarnings("ImmutableEnumChecker")
   private final DoubleBinaryOperator op;
 
   private ReRankOperator(final DoubleBinaryOperator op) {