Apache Solr open-source search software
SOLR-16427: Evaluate and fix errorprone rules - EscapedEntity / UnescapedEntity
Kevin Risden29e8cebf4b7d
diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradleindex 276bb435449..fa61cabb918 100644--- a/gradle/validation/error-prone.gradle+++ b/gradle/validation/error-prone.gradle@@ -84,7 +84,6 @@ allprojects { prj ->'-Xep:DoubleCheckedLocking:OFF','-Xep:EmptyCatch:OFF','-Xep:EqualsUnsafeCast:OFF',- '-Xep:EscapedEntity:OFF','-Xep:Finally:OFF','-Xep:FutureReturnValueIgnored:OFF','-Xep:IdentityBinaryExpression:OFF',@@ -121,7 +120,6 @@ allprojects { prj ->'-Xep:ThreadPriorityCheck:OFF','-Xep:TypeParameterShadowing:OFF','-Xep:TypeParameterUnusedInFormals:OFF',- '-Xep:UnescapedEntity:OFF','-Xep:UnicodeEscape:OFF','-Xep:UnnecessaryParentheses:OFF','-Xep:UnusedMethod:OFF',diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkDistributedCollectionLockFactory.java b/solr/core/src/java/org/apache/solr/cloud/ZkDistributedCollectionLockFactory.javaindex 56f8c61c188..9d787289c87 100644--- a/solr/core/src/java/org/apache/solr/cloud/ZkDistributedCollectionLockFactory.java+++ b/solr/core/src/java/org/apache/solr/cloud/ZkDistributedCollectionLockFactory.java@@ -63,19 +63,19 @@ public class ZkDistributedCollectionLockFactory extends ZkDistributedLockFactory** <p>The tree of lock directories for a given collection {@code collName} is as follows:*- * <pre>- * rootPath/- * collName/- * Locks <-- EPHEMERAL collection level locks go here- * _ShardName1/- * Locks <-- EPHEMERAL shard level locks go here- * _replicaNameS1R1 <-- EPHEMERAL replica level locks go here- * _replicaNameS1R2 <-- EPHEMERAL replica level locks go here- * _ShardName2/- * Locks <-- EPHEMERAL shard level locks go here- * _replicaNameS2R1 <-- EPHEMERAL replica level locks go here- * _replicaNameS2R2 <-- EPHEMERAL replica level locks go here- * </pre>+ * <pre>{@code+ * rootPath/+ * collName/+ * Locks <-- EPHEMERAL collection level locks go here+ * _ShardName1/+ * Locks <-- EPHEMERAL shard level locks go here+ * _replicaNameS1R1 <-- EPHEMERAL replica level locks go here+ * _replicaNameS1R2 <-- EPHEMERAL replica level locks go here+ * _ShardName2/+ * Locks <-- EPHEMERAL shard level locks go here+ * _replicaNameS2R1 <-- EPHEMERAL replica level locks go here+ * _replicaNameS2R2 <-- EPHEMERAL replica level locks go here+ * }</pre>** This method will create the path where the {@code EPHEMERAL} lock nodes should go. That path* is:diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkDistributedConfigSetLockFactory.java b/solr/core/src/java/org/apache/solr/cloud/ZkDistributedConfigSetLockFactory.javaindex 4ea61f63f77..488c69932a0 100644--- a/solr/core/src/java/org/apache/solr/cloud/ZkDistributedConfigSetLockFactory.java+++ b/solr/core/src/java/org/apache/solr/cloud/ZkDistributedConfigSetLockFactory.java@@ -50,12 +50,12 @@ public class ZkDistributedConfigSetLockFactory extends ZkDistributedLockFactory* <p>The tree of lock directories is very flat, given there's no real structure to what's being* locked in a config set:*- * <pre>- * rootPath/- * configSet1/ <-- EPHEMERAL config set locks go here- * configSet2/ <-- EPHEMERAL config set locks go here- * etc...- * </pre>+ * <pre>{@code+ * rootPath/+ * configSet1/ <-- EPHEMERAL config set locks go here+ * configSet2/ <-- EPHEMERAL config set locks go here+ * etc...+ * }</pre>** This method will create the path where the {@code EPHEMERAL} lock nodes should go.*diff --git a/solr/core/src/java/org/apache/solr/handler/GraphHandler.java b/solr/core/src/java/org/apache/solr/handler/GraphHandler.javaindex dafa0863de6..b5a8dfc7a05 100644--- a/solr/core/src/java/org/apache/solr/handler/GraphHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/GraphHandler.java@@ -60,14 +60,11 @@ import org.slf4j.LoggerFactory;* org.apache.solr.client.solrj.io.stream.expr.DefaultStreamFactory}.** <p>To add additional functions, just define them as plugins in solrconfig.xml via {@code- * <expressible name="count" class="org.apache.solr.client.solrj.io.stream.RecordCountStream"- * /> }+ * <expressible name="count" class="org.apache.solr.client.solrj.io.stream.RecordCountStream" />}*- * <p>The @deprecated configuration method as of Solr 8.5 is {@code <lst- * name="streamFunctions"> <str- * name="group">org.apache.solr.client.solrj.io.stream.ReducerStream</str> <str- * name="count">org.apache.solr.client.solrj.io.stream.RecordCountStream</str> </lst>- * }+ * <p>The @deprecated configuration method as of Solr 8.5 is {@code <lst name="streamFunctions"><str+ * name="group">org.apache.solr.client.solrj.io.stream.ReducerStream</str><str+ * name="count">org.apache.solr.client.solrj.io.stream.RecordCountStream</str></lst> }** @since 6.1.0*/diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.javaindex 984ca83411a..c0e279c5a29 100644--- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java@@ -76,8 +76,7 @@ import org.slf4j.LoggerFactory;* org.apache.solr.handler.SolrDefaultStreamFactory}.** <p>To add additional functions, just define them as plugins in solrconfig.xml via {@code- * <expressible name="count" class="org.apache.solr.client.solrj.io.stream.RecordCountStream"- * /> }+ * <expressible name="count" class="org.apache.solr.client.solrj.io.stream.RecordCountStream" />}** @since 5.1.0*/diff --git a/solr/core/src/java/org/apache/solr/util/hll/HLLUtil.java b/solr/core/src/java/org/apache/solr/util/hll/HLLUtil.javaindex 9a5eb5082d4..3d955f2edc6 100644--- a/solr/core/src/java/org/apache/solr/util/hll/HLLUtil.java+++ b/solr/core/src/java/org/apache/solr/util/hll/HLLUtil.java@@ -22,11 +22,11 @@ final class HLLUtil {* Precomputed <code>pwMaxMask</code> values indexed by <code>registerSizeInBits</code>.* Calculated with this formula:*- * <pre>- * int maxRegisterValue = (1 << registerSizeInBits) - 1;- * // Mask with all bits set except for (maxRegisterValue - 1) least significant bits (see #addRaw())- * return ~((1L << (maxRegisterValue - 1)) - 1);- * </pre>+ * <pre>{@code+ * int maxRegisterValue = (1 << registerSizeInBits) - 1;+ * // Mask with all bits set except for (maxRegisterValue - 1) least significant bits (see #addRaw())+ * return ~((1L << (maxRegisterValue - 1)) - 1);+ * }</pre>** @see #pwMaxMask(int)*/diff --git a/solr/core/src/java/org/apache/solr/util/hll/SerializationUtil.java b/solr/core/src/java/org/apache/solr/util/hll/SerializationUtil.javaindex f15962d50ae..7548c680d34 100644--- a/solr/core/src/java/org/apache/solr/util/hll/SerializationUtil.java+++ b/solr/core/src/java/org/apache/solr/util/hll/SerializationUtil.java@@ -137,8 +137,8 @@ class SerializationUtil {* <ul>* <li>If 'explicit-disabled' is chosen, this value should be <code>0</code>.* <li>If 'auto' is chosen, this value should be <code>63</code>.- * <li>If a cutoff of 2<sup>n</sup> is desired, for <code>0 <= n < 31</code>, this value- * should be <code>n + 1</code>.+ * <li>If a cutoff of 2<sup>n</sup> is desired, for {@code 0 <= n < 31}, this value should+ * be {@code n + 1}.* </ul>** @param sparseEnabled whether {@link HLLType#SPARSE} should be used in the promotion hierarchydiff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java b/solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.javaindex 8f6a2058e6a..d0f65eeb354 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java@@ -353,9 +353,9 @@ public class DocumentObjectBinder {/*** Called by the {@link #inject} method to read the value(s) for a field This method supports- * reading of all "matching" fieldName's in the <code>SolrDocument</code> Returns <code>- * SolrDocument.getFieldValue</code> for regular fields, and <code>Map<String, List<Object>>- * </code> for a dynamic field. The key is all matching fieldName's.+ * reading of all "matching" fieldName's in the {@link SolrDocument} Returns {@link+ * SolrDocument#getFieldValue} for regular fields, and {@code Map<String, List<Object>>} for a+ * dynamic field. The key is all matching fieldName's.*/private Object getFieldValue(SolrDocument solrDocument) {if (child != null) {