You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by kr...@apache.org on 2022/10/25 01:38:09 UTC

[solr] 06/10: SOLR-16427: Evaluate and fix errorprone rules - AlmostJavadoc

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

krisden pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git

commit d37211b438db458e6945e198931e1d652747fa31
Author: Kevin Risden <kr...@apache.org>
AuthorDate: Thu Oct 20 16:56:14 2022 -0400

    SOLR-16427: Evaluate and fix errorprone rules - AlmostJavadoc
---
 gradle/validation/error-prone.gradle               |  1 -
 .../org/apache/solr/search/facet/FacetParser.java  | 27 --------------------
 .../apache/solr/search/neural/KnnQParserTest.java  |  7 +++---
 ...uestContinuesRecorderAuthenticationHandler.java |  7 +++---
 .../prometheus/exporter/MetricsQueryTemplate.java  | 29 +++++++++++-----------
 5 files changed, 21 insertions(+), 50 deletions(-)

diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradle
index 27ca81117e8..ac5593c7c1a 100644
--- a/gradle/validation/error-prone.gradle
+++ b/gradle/validation/error-prone.gradle
@@ -74,7 +74,6 @@ allprojects { prj ->
             '-Xep:StaticAssignmentInConstructor:OFF', // we assign SolrTestCaseJ4.configString in many tests, difficult to untangle
             '-Xep:ComparableType:OFF', // SolrTestCaseJ4.Doc and Fld are messy
 
-            '-Xep:AlmostJavadoc:OFF',
             '-Xep:AlreadyChecked:OFF',
             '-Xep:AmbiguousMethodReference:OFF',
             '-Xep:ArgumentSelectionDefectChecker:OFF',
diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetParser.java b/solr/core/src/java/org/apache/solr/search/facet/FacetParser.java
index b92a4e07c41..3c7edfa826c 100644
--- a/solr/core/src/java/org/apache/solr/search/facet/FacetParser.java
+++ b/solr/core/src/java/org/apache/solr/search/facet/FacetParser.java
@@ -532,33 +532,6 @@ abstract class FacetParser<T extends FacetRequest> {
     }
   }
 
-  /* not a separate type of parser for now...
-  static class FacetBlockParentParser extends FacetParser<FacetBlockParent> {
-    public FacetBlockParentParser(FacetParser parent, String key) {
-      super(parent, key);
-      facet = new FacetBlockParent();
-    }
-
-    @Override
-    public FacetBlockParent parse(Object arg) throws SyntaxError {
-      parseCommonParams(arg);
-
-      if (arg instanceof String) {
-        // just the field name...
-        facet.parents = (String)arg;
-
-      } else if (arg instanceof Map) {
-        Map<String, Object> m = (Map<String, Object>) arg;
-        facet.parents = getString(m, "parents", null);
-
-        parseSubs( m.get("facet") );
-      }
-
-      return facet;
-    }
-  }
-  */
-
   static class FacetFieldParser extends FacetParser<FacetField> {
     public FacetFieldParser(FacetParser<?> parent, String key) {
       super(parent, key);
diff --git a/solr/core/src/test/org/apache/solr/search/neural/KnnQParserTest.java b/solr/core/src/test/org/apache/solr/search/neural/KnnQParserTest.java
index ef27333832d..48e8f3b9aa5 100644
--- a/solr/core/src/test/org/apache/solr/search/neural/KnnQParserTest.java
+++ b/solr/core/src/test/org/apache/solr/search/neural/KnnQParserTest.java
@@ -347,9 +347,10 @@ public class KnnQParserTest extends SolrTestCaseJ4 {
         "//result/doc[4]/str[@name='id'][.='3']");
   }
 
-  /*
-   * See {@link org.apache.solr.search.ReRankQParserPlugin.ReRankQueryRescorer.combine} for more details.
-   * */
+  /**
+   * See {@link org.apache.solr.search.ReRankQParserPlugin.ReRankQueryRescorer#combine(float,
+   * boolean, float)}} for more details.
+   */
   @Test
   public void knnQueryAsRerank_shouldAddSimilarityFunctionScore() {
     String vectorToSearch = "[1.0, 2.0, 3.0, 4.0]";
diff --git a/solr/modules/hadoop-auth/src/java/org/apache/solr/security/hadoop/RequestContinuesRecorderAuthenticationHandler.java b/solr/modules/hadoop-auth/src/java/org/apache/solr/security/hadoop/RequestContinuesRecorderAuthenticationHandler.java
index eb166a7b58a..7ad3b1a89ba 100644
--- a/solr/modules/hadoop-auth/src/java/org/apache/solr/security/hadoop/RequestContinuesRecorderAuthenticationHandler.java
+++ b/solr/modules/hadoop-auth/src/java/org/apache/solr/security/hadoop/RequestContinuesRecorderAuthenticationHandler.java
@@ -25,10 +25,9 @@ import org.apache.hadoop.security.authentication.client.AuthenticationException;
 import org.apache.hadoop.security.authentication.server.AuthenticationHandler;
 import org.apache.hadoop.security.authentication.server.AuthenticationToken;
 
-/*
- * {@link AuthenticationHandler} that delegates to another {@link AuthenticationHandler}
- * and records the response of managementOperation (which indicates whether the request
- * should continue or not).
+/**
+ * {@link AuthenticationHandler} that delegates to another {@link AuthenticationHandler} and records
+ * the response of managementOperation (which indicates whether the request should continue or not).
  */
 public class RequestContinuesRecorderAuthenticationHandler implements AuthenticationHandler {
   // filled in by Plugin/Filter
diff --git a/solr/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/MetricsQueryTemplate.java b/solr/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/MetricsQueryTemplate.java
index 336dc2867ce..b273b862ee4 100644
--- a/solr/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/MetricsQueryTemplate.java
+++ b/solr/prometheus-exporter/src/java/org/apache/solr/prometheus/exporter/MetricsQueryTemplate.java
@@ -23,21 +23,20 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 public class MetricsQueryTemplate {
-  /*
-  A regex with named groups is used to match template references to template + vars using the basic pattern:
-
-      $jq:<TEMPLATE>( <UNIQUE>, <KEYSELECTOR>, <METRIC>, <TYPE> )
-
-  For instance,
-
-      $jq:core(requests_total, endswith(".requestTimes"), count, COUNTER)
-
-  TEMPLATE = core
-  UNIQUE = requests_total (unique suffix for this metric, results in a metric named "solr_metrics_core_requests_total")
-  KEYSELECTOR = endswith(".requestTimes") (filter to select the specific key for this metric)
-  METRIC = count
-  TYPE = COUNTER
-  */
+  /**
+   * A regex with named groups is used to match template references to template + vars using the
+   * basic pattern:
+   *
+   * <p>$jq:<TEMPLATE>( <UNIQUE>, <KEYSELECTOR>, <METRIC>, <TYPE> )
+   *
+   * <p>For instance,
+   *
+   * <p>$jq:core(requests_total, endswith(".requestTimes"), count, COUNTER)
+   *
+   * <p>TEMPLATE = core UNIQUE = requests_total (unique suffix for this metric, results in a metric
+   * named "solr_metrics_core_requests_total") KEYSELECTOR = endswith(".requestTimes") (filter to
+   * select the specific key for this metric) METRIC = count TYPE = COUNTER
+   */
   private static final Pattern matchJqTemplate =
       Pattern.compile(
           "^\\$jq:(?<TEMPLATE>.*?)\\(\\s?(?<UNIQUE>[^,]*),\\s?(?<KEYSELECTOR>[^,]*)(,\\s?(?<METRIC>[^,]*)\\s?)?(,\\s?(?<TYPE>[^,]*)\\s?)?\\)$");