Apache Solr open-source search software
SOLR-16427: Evaluate and fix errorprone rules - HidingField
Kevin Risdenc0eebe3210b2
diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradleindex a97b42fa4e2..276bb435449 100644--- a/gradle/validation/error-prone.gradle+++ b/gradle/validation/error-prone.gradle@@ -87,7 +87,6 @@ allprojects { prj ->'-Xep:EscapedEntity:OFF','-Xep:Finally:OFF','-Xep:FutureReturnValueIgnored:OFF',- '-Xep:HidingField:OFF','-Xep:IdentityBinaryExpression:OFF','-Xep:IdentityHashMapUsage:OFF','-Xep:ImmutableEnumChecker:OFF',diff --git a/solr/core/src/java/org/apache/solr/logging/log4j2/Log4j2Watcher.java b/solr/core/src/java/org/apache/solr/logging/log4j2/Log4j2Watcher.javaindex ff1ef3f456e..7cc2d3e66ed 100644--- a/solr/core/src/java/org/apache/solr/logging/log4j2/Log4j2Watcher.java+++ b/solr/core/src/java/org/apache/solr/logging/log4j2/Log4j2Watcher.java@@ -79,16 +79,16 @@ public class Log4j2Watcher extends LogWatcher<LogEvent> {@SuppressForbidden(reason = "class is specific to log4j2")protected static class Log4j2Info extends LoggerInfo {- final Level level;-Log4j2Info(String name, Level level) {super(name);- this.level = level;+ if (level != null) {+ this.level = level.toString();+ }}@Overridepublic String getLevel() {- return (level != null) ? level.toString() : null;+ return (level != null) ? level : null;}@Override@@ -98,7 +98,7 @@ public class Log4j2Watcher extends LogWatcher<LogEvent> {@Overridepublic boolean isSet() {- return (level != null) ? true : false;+ return level != null;}}diff --git a/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java b/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.javaindex 1935abcc8f2..05df434bf37 100644--- a/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java+++ b/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java@@ -20,7 +20,6 @@ import java.io.CharArrayWriter;import java.io.IOException;import java.io.Writer;import java.util.ArrayList;-import java.util.Calendar;import java.util.Collection;import java.util.LinkedHashMap;import java.util.List;@@ -151,8 +150,6 @@ class CSVWriter extends TabularResponseWriter {int pass;Map<String, CSVField> csvFields = new LinkedHashMap<>();- Calendar cal; // for formatting date objects-CSVStrategy strategy; // strategy for encoding the fields of documentsCSVPrinter printer;ResettableFastWriter mvWriter = new ResettableFastWriter(); // writer used for multi-valued fieldsdiff --git a/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.javaindex 68f7e1cdd76..3edb2073712 100644--- a/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java+++ b/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java@@ -1523,7 +1523,6 @@ public class CollapsingQParserPlugin extends QParserPlugin {protected final boolean needsScores;protected final boolean expandNulls;private final MergeBoost boostDocs;- private int docBase = 0;protected AbstractBlockCollector(final String collapseField,diff --git a/solr/core/src/java/org/apache/solr/search/FunctionRangeQuery.java b/solr/core/src/java/org/apache/solr/search/FunctionRangeQuery.javaindex ad316d710e6..db71c7d6589 100644--- a/solr/core/src/java/org/apache/solr/search/FunctionRangeQuery.java+++ b/solr/core/src/java/org/apache/solr/search/FunctionRangeQuery.java@@ -62,7 +62,7 @@ public class FunctionRangeQuery extends ExtendedQueryBase implements PostFilterclass FunctionRangeCollector extends DelegatingCollector {final Map<Object, Object> fcontext;final Weight weight;- ValueSourceScorer scorer;+ ValueSourceScorer valueSourceScorer;int maxdoc;public FunctionRangeCollector(Map<Object, Object> fcontext, Weight weight) {@@ -73,7 +73,7 @@ public class FunctionRangeQuery extends ExtendedQueryBase implements PostFilter@Overridepublic void collect(int doc) throws IOException {assert doc < maxdoc;- if (scorer.matches(doc)) {+ if (valueSourceScorer.matches(doc)) {leafDelegate.collect(doc);}}@@ -83,7 +83,7 @@ public class FunctionRangeQuery extends ExtendedQueryBase implements PostFiltersuper.doSetNextReader(context);maxdoc = context.reader().maxDoc();FunctionValues dv = rangeFilt.getValueSource().getValues(fcontext, context);- scorer =+ valueSourceScorer =dv.getRangeScorer(weight,context,diff --git a/solr/core/src/java/org/apache/solr/security/MultiDestinationAuditLogger.java b/solr/core/src/java/org/apache/solr/security/MultiDestinationAuditLogger.javaindex dd22abf91bd..5dc04422f78 100644--- a/solr/core/src/java/org/apache/solr/security/MultiDestinationAuditLogger.java+++ b/solr/core/src/java/org/apache/solr/security/MultiDestinationAuditLogger.java@@ -54,7 +54,6 @@ public class MultiDestinationAuditLogger extends AuditLoggerPlugin implements Reprivate ResourceLoader loader;List<AuditLoggerPlugin> plugins = new ArrayList<>();List<String> pluginNames = new ArrayList<>();- SolrMetricsContext solrMetricsContext;/*** Passes the AuditEvent to all sub plugins in parallel. The event should be a {@link AuditEvent}diff --git a/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateProcessorFactory.javaindex 5f1a3574363..8416e0eca9f 100644--- a/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateProcessorFactory.java+++ b/solr/core/src/java/org/apache/solr/update/processor/AtomicUpdateProcessorFactory.java@@ -92,11 +92,8 @@ public class AtomicUpdateProcessorFactory extends UpdateRequestProcessorFactory@SuppressWarnings("unused")private final SolrQueryRequest req;- private final UpdateRequestProcessor next;-private AtomicUpdateProcessor(SolrQueryRequest req, UpdateRequestProcessor next) {super(next);- this.next = next;this.req = req;}diff --git a/solr/core/src/test/org/apache/solr/cloud/DocValuesNotIndexedTest.java b/solr/core/src/test/org/apache/solr/cloud/DocValuesNotIndexedTest.javaindex 7259eb2f707..f7947c5f2e4 100644--- a/solr/core/src/test/org/apache/solr/cloud/DocValuesNotIndexedTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/DocValuesNotIndexedTest.java@@ -19,7 +19,6 @@ package org.apache.solr.cloud;import static org.apache.lucene.tests.util.LuceneTestCase.random;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.io.IOException;import java.time.Instant;import java.util.ArrayList;@@ -52,15 +51,9 @@ import org.apache.solr.common.SolrInputDocument;import org.junit.AfterClass;import org.junit.Before;import org.junit.BeforeClass;-import org.junit.Rule;import org.junit.Test;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;public class DocValuesNotIndexedTest extends SolrCloudTestCase {-- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-static final String COLLECTION = "dv_coll";static volatile List<FieldProps> fieldsToTestSingle = null;diff --git a/solr/core/src/test/org/apache/solr/cloud/SolrXmlInZkTest.java b/solr/core/src/test/org/apache/solr/cloud/SolrXmlInZkTest.javaindex 8f9c27e4915..36413dccd02 100644--- a/solr/core/src/test/org/apache/solr/cloud/SolrXmlInZkTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/SolrXmlInZkTest.java@@ -16,7 +16,6 @@*/package org.apache.solr.cloud;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.io.File;import java.lang.invoke.MethodHandles;import java.nio.charset.StandardCharsets;@@ -27,19 +26,13 @@ import org.apache.solr.SolrTestCaseJ4;import org.apache.solr.common.SolrException;import org.apache.solr.common.cloud.SolrZkClient;import org.apache.solr.core.NodeConfig;-import org.junit.Rule;import org.junit.Test;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;import org.slf4j.Logger;import org.slf4j.LoggerFactory;public class SolrXmlInZkTest extends SolrTestCaseJ4 {-private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-protected ZkTestServer zkServer;protected Path zkDir;diff --git a/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java b/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.javaindex 78cc987b76e..0ddf70c360f 100644--- a/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/ZkControllerTest.java@@ -409,7 +409,6 @@ public class ZkControllerTest extends SolrTestCaseJ4 {private static class MockCoreContainer extends CoreContainer {UpdateShardHandler updateShardHandler =new UpdateShardHandler(UpdateShardHandlerConfig.DEFAULT);- SolrMetricManager metricManager;public MockCoreContainer() {super(SolrXmlConfig.fromString(TEST_PATH(), "<solr/>"));diff --git a/solr/core/src/test/org/apache/solr/core/TestBackupRepositoryFactory.java b/solr/core/src/test/org/apache/solr/core/TestBackupRepositoryFactory.javaindex 7417ccb0c2f..34551c9b342 100644--- a/solr/core/src/test/org/apache/solr/core/TestBackupRepositoryFactory.java+++ b/solr/core/src/test/org/apache/solr/core/TestBackupRepositoryFactory.java@@ -16,7 +16,6 @@*/package org.apache.solr.core;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.io.File;import java.util.Arrays;import java.util.Collections;@@ -31,14 +30,9 @@ import org.apache.solr.core.backup.repository.LocalFileSystemRepository;import org.apache.solr.schema.FieldType;import org.junit.AfterClass;import org.junit.BeforeClass;-import org.junit.Rule;import org.junit.Test;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;public class TestBackupRepositoryFactory extends SolrTestCaseJ4 {- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-// tmp dir, cleaned up automatically.private static File solrHome = null;private static SolrResourceLoader loader = null;diff --git a/solr/core/src/test/org/apache/solr/core/TestSolrXml.java b/solr/core/src/test/org/apache/solr/core/TestSolrXml.javaindex 00391178bd0..7379cc906bb 100644--- a/solr/core/src/test/org/apache/solr/core/TestSolrXml.java+++ b/solr/core/src/test/org/apache/solr/core/TestSolrXml.java@@ -18,7 +18,6 @@ package org.apache.solr.core;import static org.hamcrest.core.StringContains.containsString;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.io.File;import java.io.IOException;import java.nio.file.Files;@@ -36,14 +35,8 @@ import org.apache.solr.update.UpdateShardHandlerConfig;import org.hamcrest.MatcherAssert;import org.junit.Before;import org.junit.Ignore;-import org.junit.Rule;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;public class TestSolrXml extends SolrTestCaseJ4 {-- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-// tmp dir, cleaned up automatically.private Path solrHome;diff --git a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.javaindex 11a11cab478..e39bd902eea 100644--- a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java+++ b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminHandlerTest.java@@ -16,7 +16,6 @@*/package org.apache.solr.handler.admin;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.io.File;import java.io.FileInputStream;import java.io.InputStreamReader;@@ -45,10 +44,7 @@ import org.apache.solr.core.CoreDescriptor;import org.apache.solr.core.SolrCore;import org.apache.solr.response.SolrQueryResponse;import org.junit.BeforeClass;-import org.junit.Rule;import org.junit.Test;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;public class CoreAdminHandlerTest extends SolrTestCaseJ4 {@@ -57,8 +53,6 @@ public class CoreAdminHandlerTest extends SolrTestCaseJ4 {initCore("solrconfig.xml", "schema.xml");}- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-public String getCoreName() {return this.getClass().getName() + "_sys_vars";}diff --git a/solr/core/src/test/org/apache/solr/handler/admin/CoreMergeIndexesAdminHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/CoreMergeIndexesAdminHandlerTest.javaindex eda0d06eba1..7de13638991 100644--- a/solr/core/src/test/org/apache/solr/handler/admin/CoreMergeIndexesAdminHandlerTest.java+++ b/solr/core/src/test/org/apache/solr/handler/admin/CoreMergeIndexesAdminHandlerTest.java@@ -16,7 +16,6 @@*/package org.apache.solr.handler.admin;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.io.File;import java.io.IOException;import org.apache.lucene.store.Directory;@@ -30,21 +29,15 @@ import org.apache.solr.core.MockFSDirectoryFactory;import org.apache.solr.core.SolrCore;import org.apache.solr.response.SolrQueryResponse;import org.junit.BeforeClass;-import org.junit.Rule;import org.junit.Test;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;public class CoreMergeIndexesAdminHandlerTest extends SolrTestCaseJ4 {-@BeforeClasspublic static void beforeClass() throws Exception {useFactory(FailingDirectoryFactory.class.getName());initCore("solrconfig.xml", "schema.xml");}- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-private static String WRAPPED_FAILING_MSG = "Error handling 'mergeindexes' action";private static String FAILING_CAUSE_MSG ="Creating a directory using FailingDirectoryFactoryException always fails";diff --git a/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.javaindex e0f0e14a534..43d3955519b 100644--- a/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java+++ b/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java@@ -21,7 +21,6 @@ import static org.apache.solr.common.params.CursorMarkParams.CURSOR_MARK_PARAM;import static org.apache.solr.common.params.CursorMarkParams.CURSOR_MARK_START;import static org.apache.solr.common.util.Utils.fromJSONString;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.io.File;import java.io.FileOutputStream;import java.io.OutputStreamWriter;@@ -48,17 +47,11 @@ import org.apache.solr.search.CollapsingQParserPlugin;import org.apache.solr.search.SolrIndexSearcher;import org.junit.Before;import org.junit.BeforeClass;-import org.junit.Rule;import org.junit.Test;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;import org.slf4j.Logger;import org.slf4j.LoggerFactory;public class QueryElevationComponentTest extends SolrTestCaseJ4 {-- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());@BeforeClassdiff --git a/solr/core/src/test/org/apache/solr/handler/component/TermVectorComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/TermVectorComponentTest.javaindex f5d206aa3a2..670a4d8aef2 100644--- a/solr/core/src/test/org/apache/solr/handler/component/TermVectorComponentTest.java+++ b/solr/core/src/test/org/apache/solr/handler/component/TermVectorComponentTest.java@@ -16,23 +16,16 @@*/package org.apache.solr.handler.component;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.util.ArrayList;import java.util.Arrays;import java.util.List;import org.apache.solr.SolrTestCaseJ4;import org.apache.solr.common.params.TermVectorParams;import org.junit.BeforeClass;-import org.junit.Rule;import org.junit.Test;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;/** */public class TermVectorComponentTest extends SolrTestCaseJ4 {-- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-// ensure that we operate correctly with all valid combinations of the uniqueKey being// stored and/or in docValues.@BeforeClassdiff --git a/solr/core/src/test/org/apache/solr/metrics/MetricsConfigTest.java b/solr/core/src/test/org/apache/solr/metrics/MetricsConfigTest.javaindex 45c1e3f7601..eff63f4db72 100644--- a/solr/core/src/test/org/apache/solr/metrics/MetricsConfigTest.java+++ b/solr/core/src/test/org/apache/solr/metrics/MetricsConfigTest.java@@ -16,7 +16,6 @@*/package org.apache.solr.metrics;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import com.codahale.metrics.Clock;import com.codahale.metrics.ExponentiallyDecayingReservoir;import com.codahale.metrics.Reservoir;@@ -28,15 +27,10 @@ import java.util.Properties;import org.apache.solr.SolrTestCaseJ4;import org.apache.solr.core.NodeConfig;import org.apache.solr.core.SolrXmlConfig;-import org.junit.Rule;import org.junit.Test;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;/** */public class MetricsConfigTest extends SolrTestCaseJ4 {- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-@Testpublic void testDefaults() {NodeConfig cfg = loadNodeConfig("solr-metricsconfig.xml");diff --git a/solr/core/src/test/org/apache/solr/response/TestRetrieveFieldsOptimizer.java b/solr/core/src/test/org/apache/solr/response/TestRetrieveFieldsOptimizer.javaindex 66c4f80edb6..aa147068bd0 100644--- a/solr/core/src/test/org/apache/solr/response/TestRetrieveFieldsOptimizer.java+++ b/solr/core/src/test/org/apache/solr/response/TestRetrieveFieldsOptimizer.java@@ -22,7 +22,6 @@ import static org.apache.solr.search.SolrReturnFields.FIELD_SOURCES.ALL_FROM_DV;import static org.apache.solr.search.SolrReturnFields.FIELD_SOURCES.ALL_FROM_STORED;import static org.apache.solr.search.SolrReturnFields.FIELD_SOURCES.MIXED_SOURCES;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.io.ByteArrayInputStream;import java.io.ByteArrayOutputStream;import java.time.Instant;@@ -60,15 +59,9 @@ import org.apache.solr.search.SolrIndexSearcher;import org.apache.solr.search.SolrReturnFields;import org.apache.solr.util.RefCounted;import org.junit.BeforeClass;-import org.junit.Rule;import org.junit.Test;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;public class TestRetrieveFieldsOptimizer extends SolrTestCaseJ4 {-- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-@BeforeClasspublic static void initManagedSchemaCore() throws Exception {// This testing approach means no schema file or per-test temp solr-home!diff --git a/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.java b/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.javaindex 43bc7203277..04046d0e5f9 100644--- a/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.java+++ b/solr/core/src/test/org/apache/solr/update/SolrCmdDistributorTest.java@@ -70,7 +70,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {STANDARD};- private AtomicInteger id = new AtomicInteger();+ private final AtomicInteger uniqueId = new AtomicInteger();@BeforeClasspublic static void beforeClass() {@@ -175,7 +175,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {nodes.add(new StdNode(new ZkCoreNodeProps(nodeProps)));// add one doc to controlClient- cmd.solrDoc = sdoc("id", id.incrementAndGet());+ cmd.solrDoc = sdoc("id", uniqueId.incrementAndGet());params = new ModifiableSolrParams();cmdDistrib.distribAdd(cmd, nodes, params);@@ -201,12 +201,12 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {int id2;// add another 2 docs to control and 3 to clienttry (SolrCmdDistributor cmdDistrib = new SolrCmdDistributor(updateShardHandler)) {- cmd.solrDoc = sdoc("id", id.incrementAndGet());+ cmd.solrDoc = sdoc("id", uniqueId.incrementAndGet());params = new ModifiableSolrParams();params.set(DistributedUpdateProcessor.COMMIT_END_POINT, true);cmdDistrib.distribAdd(cmd, nodes, params);- id2 = id.incrementAndGet();+ id2 = uniqueId.incrementAndGet();AddUpdateCommand cmd2 = new AddUpdateCommand(null);cmd2.solrDoc = sdoc("id", id2);@@ -215,7 +215,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {cmdDistrib.distribAdd(cmd2, nodes, params);AddUpdateCommand cmd3 = new AddUpdateCommand(null);- cmd3.solrDoc = sdoc("id", id.incrementAndGet());+ cmd3.solrDoc = sdoc("id", uniqueId.incrementAndGet());params = new ModifiableSolrParams();params.set(DistributedUpdateProcessor.COMMIT_END_POINT, true);@@ -290,7 +290,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {nodes.add(new StdNode(new ZkCoreNodeProps(nodeProps)));}AddUpdateCommand c = new AddUpdateCommand(null);- c.solrDoc = sdoc("id", id.incrementAndGet());+ c.solrDoc = sdoc("id", uniqueId.incrementAndGet());if (nodes.size() > 0) {params = new ModifiableSolrParams();cmdDistrib.distribAdd(c, nodes, params);@@ -408,7 +408,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {for (int i = 0; i < 5; i++) {AddUpdateCommand cmd = new AddUpdateCommand(null);- int currentId = id.incrementAndGet();+ int currentId = uniqueId.incrementAndGet();cmd.solrDoc = sdoc("id", currentId);ModifiableSolrParams params = new ModifiableSolrParams();cmdDistrib.distribAdd(cmd, nodes, params);@@ -483,7 +483,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {}AddUpdateCommand cmd = new AddUpdateCommand(null);- cmd.solrDoc = sdoc("id", id.incrementAndGet());+ cmd.solrDoc = sdoc("id", uniqueId.incrementAndGet());ModifiableSolrParams params = new ModifiableSolrParams();RollupRequestReplicationTracker rollupReqTracker = new RollupRequestReplicationTracker();LeaderRequestReplicationTracker leaderReqTracker =@@ -539,7 +539,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {nodes.add(retryNode);AddUpdateCommand cmd = new AddUpdateCommand(null);- cmd.solrDoc = sdoc("id", id.incrementAndGet());+ cmd.solrDoc = sdoc("id", uniqueId.incrementAndGet());ModifiableSolrParams params = new ModifiableSolrParams();cmdDistrib.distribAdd(cmd, nodes, params);@@ -665,7 +665,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {nodes.add(retryNode);AddUpdateCommand cmd = new AddUpdateCommand(null);- cmd.solrDoc = sdoc("id", id.incrementAndGet());+ cmd.solrDoc = sdoc("id", uniqueId.incrementAndGet());ModifiableSolrParams params = new ModifiableSolrParams();CommitUpdateCommand ccmd = new CommitUpdateCommand(null, false);@@ -723,7 +723,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {nodes.add(retryNode);AddUpdateCommand cmd = new AddUpdateCommand(null);- cmd.solrDoc = sdoc("id", id.incrementAndGet());+ cmd.solrDoc = sdoc("id", uniqueId.incrementAndGet());ModifiableSolrParams params = new ModifiableSolrParams();CommitUpdateCommand ccmd = new CommitUpdateCommand(null, false);@@ -773,7 +773,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {nodes.add(retryNode);AddUpdateCommand cmd = new AddUpdateCommand(null);- cmd.solrDoc = sdoc("id", id.incrementAndGet());+ cmd.solrDoc = sdoc("id", uniqueId.incrementAndGet());ModifiableSolrParams params = new ModifiableSolrParams();CommitUpdateCommand ccmd = new CommitUpdateCommand(null, false);@@ -821,7 +821,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {nodes.add(retryNode);AddUpdateCommand cmd = new AddUpdateCommand(null);- cmd.solrDoc = sdoc("id", id.incrementAndGet());+ cmd.solrDoc = sdoc("id", uniqueId.incrementAndGet());ModifiableSolrParams params = new ModifiableSolrParams();cmdDistrib.distribAdd(cmd, nodes, params);@@ -862,7 +862,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {nodes.add(retryNode);AddUpdateCommand cmd = new AddUpdateCommand(null);- cmd.solrDoc = sdoc("id", id.incrementAndGet());+ cmd.solrDoc = sdoc("id", uniqueId.incrementAndGet());ModifiableSolrParams params = new ModifiableSolrParams();cmdDistrib.distribAdd(cmd, nodes, params);@@ -936,7 +936,7 @@ public class SolrCmdDistributorTest extends BaseDistributedSearchTestCase {nodes.add(node);}AddUpdateCommand c = new AddUpdateCommand(null);- c.solrDoc = sdoc("id", id.incrementAndGet());+ c.solrDoc = sdoc("id", uniqueId.incrementAndGet());if (nodes.size() > 0) {params = new ModifiableSolrParams();cmdDistrib.distribAdd(c, nodes, params, false);diff --git a/solr/core/src/test/org/apache/solr/util/TestCircuitBreaker.java b/solr/core/src/test/org/apache/solr/util/TestCircuitBreaker.javaindex e39b63d7f39..c89b92281f6 100644--- a/solr/core/src/test/org/apache/solr/util/TestCircuitBreaker.java+++ b/solr/core/src/test/org/apache/solr/util/TestCircuitBreaker.java@@ -19,7 +19,6 @@ package org.apache.solr.util;import static org.hamcrest.CoreMatchers.containsString;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.lang.invoke.MethodHandles;import java.util.ArrayList;import java.util.HashMap;@@ -42,9 +41,6 @@ import org.apache.solr.util.circuitbreaker.MemoryCircuitBreaker;import org.hamcrest.MatcherAssert;import org.junit.After;import org.junit.BeforeClass;-import org.junit.Rule;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;import org.slf4j.Logger;import org.slf4j.LoggerFactory;@@ -52,8 +48,6 @@ public class TestCircuitBreaker extends SolrTestCaseJ4 {private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());private static final int NUM_DOCS = 20;- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-@BeforeClasspublic static void setUpClass() throws Exception {System.setProperty("filterCache.enabled", "false");diff --git a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsTransactionLog.java b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsTransactionLog.javaindex 83664b30670..c7bca1b9aa6 100644--- a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsTransactionLog.java+++ b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsTransactionLog.java@@ -378,7 +378,7 @@ public class HdfsTransactionLog extends TransactionLog {}public class HDFSLogReader extends LogReader {- FSDataFastInputStream fis;+ FSDataFastInputStream hdfsFis;private LogCodec codec = new LogCodec(resolver);private long sz;@@ -397,7 +397,7 @@ public class HdfsTransactionLog extends TransactionLog {}FSDataInputStream fdis = fs.open(tlogFile);- fis = new FSDataFastInputStream(fdis, pos);+ hdfsFis = new FSDataFastInputStream(fdis, pos);} catch (IOException e) {throw new RuntimeException(e);}@@ -411,7 +411,7 @@ public class HdfsTransactionLog extends TransactionLog {*/@Overridepublic Object next() throws IOException, InterruptedException {- long pos = fis.position();+ long pos = hdfsFis.position();synchronized (HdfsTransactionLog.this) {if (trace) {@@ -428,28 +428,28 @@ public class HdfsTransactionLog extends TransactionLog {if (pos >= sz) {log.info("Read available inputstream data, opening new inputstream pos={} sz={}", pos, sz);- fis.close();+ hdfsFis.close();initStream(pos);}if (pos == 0) {- readHeader(fis);+ readHeader(hdfsFis);// shouldn't currently happen - header and first record are currently written at the same// timesynchronized (HdfsTransactionLog.this) {- if (fis.position() >= getLogSize()) {+ if (hdfsFis.position() >= getLogSize()) {return null;}- pos = fis.position();+ pos = hdfsFis.position();}}- Object o = codec.readVal(fis);+ Object o = codec.readVal(hdfsFis);// skip over record size- int size = fis.readInt();- assert size == fis.position() - pos - 4;+ int size = hdfsFis.readInt();+ assert size == hdfsFis.position() - pos - 4;return o;}@@ -457,7 +457,7 @@ public class HdfsTransactionLog extends TransactionLog {@Overridepublic void close() {try {- fis.close();+ hdfsFis.close();} catch (IOException e) {throw new RuntimeException(e);}@@ -471,7 +471,7 @@ public class HdfsTransactionLog extends TransactionLog {+ "file="+ tlogFile+ ", position="- + fis.position()+ + hdfsFis.position()+ ", end="+ getLogSize()+ "}";@@ -480,7 +480,7 @@ public class HdfsTransactionLog extends TransactionLog {@Overridepublic long currentPos() {- return fis.position();+ return hdfsFis.position();}@Override@@ -518,7 +518,7 @@ public class HdfsTransactionLog extends TransactionLog {if (version < lastVersion) inOrder = false;lastVersion = version;}- fis.seek(startingPos);+ hdfsFis.seek(startingPos);}if (inOrder) {@@ -527,7 +527,7 @@ public class HdfsTransactionLog extends TransactionLog {if (iterator == null) iterator = versionToPos.values().iterator();if (!iterator.hasNext()) return null;long pos = iterator.next();- if (pos != currentPos()) fis.seek(pos);+ if (pos != currentPos()) hdfsFis.seek(pos);return super.next();}}@@ -648,18 +648,18 @@ public class HdfsTransactionLog extends TransactionLog {}class FSDataFastInputStream extends FastInputStream {- private FSDataInputStream fis;+ private final FSDataInputStream hdfsFis;- public FSDataFastInputStream(FSDataInputStream fis, long chPosition) {+ public FSDataFastInputStream(FSDataInputStream hdfsFis, long chPosition) {// super(null, new byte[10],0,0); // a small buffer size for testing purposessuper(null);- this.fis = fis;+ this.hdfsFis = hdfsFis;super.readFromStream = chPosition;}@Overridepublic int readWrappedStream(byte[] target, int offset, int len) throws IOException {- return fis.read(readFromStream, target, offset, len);+ return hdfsFis.read(readFromStream, target, offset, len);}public void seek(long position) throws IOException {@@ -688,7 +688,7 @@ class FSDataFastInputStream extends FastInputStream {@Overridepublic void close() throws IOException {- fis.close();+ hdfsFis.close();}@Overridediff --git a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsUpdateLog.java b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsUpdateLog.javaindex f42b07a824a..dfe7944a15a 100644--- a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsUpdateLog.java+++ b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/update/HdfsUpdateLog.java@@ -53,7 +53,7 @@ public class HdfsUpdateLog extends UpdateLog {private final Object fsLock = new Object();private FileSystem fs;- private volatile Path tlogDir;+ private volatile Path hdfsTlogDir;private final String confDir;private Integer tlogDfsReplication;@@ -131,7 +131,7 @@ public class HdfsUpdateLog extends UpdateLog {if (debug) {log.debug("UpdateHandler init: tlogDir={}, next id={} this is a reopen or double init ... nothing else to do.",- tlogDir,+ hdfsTlogDir,id);}versionInfo.reload();@@ -139,16 +139,16 @@ public class HdfsUpdateLog extends UpdateLog {}}- tlogDir = new Path(dataDir, TLOG_NAME);+ hdfsTlogDir = new Path(dataDir, TLOG_NAME);while (true) {try {- if (!fs.exists(tlogDir)) {- boolean success = fs.mkdirs(tlogDir);+ if (!fs.exists(hdfsTlogDir)) {+ boolean success = fs.mkdirs(hdfsTlogDir);if (!success) {- throw new RuntimeException("Could not create directory:" + tlogDir);+ throw new RuntimeException("Could not create directory:" + hdfsTlogDir);}} else {- fs.mkdirs(tlogDir); // To check for safe mode+ fs.mkdirs(hdfsTlogDir); // To check for safe mode}break;} catch (RemoteException e) {@@ -161,32 +161,32 @@ public class HdfsUpdateLog extends UpdateLog {}continue;}- throw new RuntimeException("Problem creating directory: " + tlogDir, e);+ throw new RuntimeException("Problem creating directory: " + hdfsTlogDir, e);} catch (IOException e) {- throw new RuntimeException("Problem creating directory: " + tlogDir, e);+ throw new RuntimeException("Problem creating directory: " + hdfsTlogDir, e);}}- String[] oldBufferTlog = getBufferLogList(fs, tlogDir);+ String[] oldBufferTlog = getBufferLogList(fs, hdfsTlogDir);if (oldBufferTlog != null && oldBufferTlog.length != 0) {existOldBufferLog = true;}- tlogFiles = getLogList(fs, tlogDir);+ tlogFiles = getLogList(fs, hdfsTlogDir);id = getLastLogId() + 1; // add 1 since we will create a new log for the// next updateif (debug) {log.debug("UpdateHandler init: tlogDir={}, existing tlogs={}, next id={}",- tlogDir,+ hdfsTlogDir,Arrays.asList(tlogFiles),id);}TransactionLog oldLog = null;for (String oldLogName : tlogFiles) {- Path f = new Path(tlogDir, oldLogName);+ Path f = new Path(hdfsTlogDir, oldLogName);try {oldLog = new HdfsTransactionLog(fs, f, null, true, tlogDfsReplication);addOldLog(oldLog, false); // don't remove old logs on startup since more@@ -253,7 +253,7 @@ public class HdfsUpdateLog extends UpdateLog {@Overridepublic String getLogDir() {- return tlogDir.toUri().toString();+ return hdfsTlogDir.toUri().toString();}public static String[] getBufferLogList(FileSystem fs, Path tlogDir) {@@ -321,17 +321,17 @@ public class HdfsUpdateLog extends UpdateLog {String.format(Locale.ROOT, LOG_FILENAME_PATTERN, BUFFER_TLOG_NAME, System.nanoTime());bufferTlog =new HdfsTransactionLog(- fs, new Path(tlogDir, newLogName), globalStrings, tlogDfsReplication);+ fs, new Path(hdfsTlogDir, newLogName), globalStrings, tlogDfsReplication);bufferTlog.isBuffer = true;}@Overrideprotected void deleteBufferLogs() {// Delete old buffer logs- String[] oldBufferTlog = getBufferLogList(fs, tlogDir);+ String[] oldBufferTlog = getBufferLogList(fs, hdfsTlogDir);if (oldBufferTlog != null && oldBufferTlog.length != 0) {for (String oldBufferLogName : oldBufferTlog) {- Path f = new Path(tlogDir, oldBufferLogName);+ Path f = new Path(hdfsTlogDir, oldBufferLogName);try {boolean s = fs.delete(f, false);if (!s) {@@ -351,7 +351,7 @@ public class HdfsUpdateLog extends UpdateLog {String newLogName = String.format(Locale.ROOT, LOG_FILENAME_PATTERN, TLOG_NAME, id);HdfsTransactionLog ntlog =new HdfsTransactionLog(- fs, new Path(tlogDir, newLogName), globalStrings, tlogDfsReplication);+ fs, new Path(hdfsTlogDir, newLogName), globalStrings, tlogDfsReplication);tlog = ntlog;}}diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/SharedFileSystemAutoReplicaFailoverTest.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/SharedFileSystemAutoReplicaFailoverTest.javaindex 98a1d771df9..817083afd10 100644--- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/SharedFileSystemAutoReplicaFailoverTest.java+++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/SharedFileSystemAutoReplicaFailoverTest.java@@ -30,7 +30,6 @@ import java.util.concurrent.CompletionService;import java.util.concurrent.ExecutorCompletionService;import java.util.concurrent.Future;import java.util.concurrent.SynchronousQueue;-import java.util.concurrent.ThreadPoolExecutor;import java.util.concurrent.TimeUnit;import java.util.stream.Collectors;import org.apache.hadoop.hdfs.MiniDFSCluster;@@ -89,15 +88,6 @@ public class SharedFileSystemAutoReplicaFailoverTest extends AbstractFullDistribprivate static final boolean DEBUG = true;private static MiniDFSCluster dfsCluster;- ThreadPoolExecutor executor =- new ExecutorUtil.MDCAwareThreadPoolExecutor(- 0,- Integer.MAX_VALUE,- 5,- TimeUnit.SECONDS,- new SynchronousQueue<>(),- new SolrNamedThreadFactory("testExecutor"));-CompletionService<Object> completionService;Set<Future<Object>> pending;private final Map<String, String> collectionUlogDirMap = new HashMap<>();@@ -141,6 +131,14 @@ public class SharedFileSystemAutoReplicaFailoverTest extends AbstractFullDistrib}public SharedFileSystemAutoReplicaFailoverTest() {+ executor =+ new ExecutorUtil.MDCAwareThreadPoolExecutor(+ 0,+ Integer.MAX_VALUE,+ 5,+ TimeUnit.SECONDS,+ new SynchronousQueue<>(),+ new SolrNamedThreadFactory("testExecutor"));completionService = new ExecutorCompletionService<>(executor);pending = new HashSet<>();}diff --git a/solr/modules/jaegertracer-configurator/src/test/org/apache/solr/jaeger/TestJaegerConfigurator.java b/solr/modules/jaegertracer-configurator/src/test/org/apache/solr/jaeger/TestJaegerConfigurator.javaindex 4a8cdd9498b..4759c5ced19 100644--- a/solr/modules/jaegertracer-configurator/src/test/org/apache/solr/jaeger/TestJaegerConfigurator.java+++ b/solr/modules/jaegertracer-configurator/src/test/org/apache/solr/jaeger/TestJaegerConfigurator.java@@ -18,7 +18,6 @@package org.apache.solr.jaeger;import com.carrotsearch.randomizedtesting.annotations.ThreadLeakLingering;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import io.opentracing.util.GlobalTracer;import java.util.concurrent.TimeUnit;import org.apache.solr.SolrTestCaseJ4;@@ -30,15 +29,10 @@ import org.apache.solr.common.util.ExecutorUtil;import org.apache.solr.common.util.TimeSource;import org.apache.solr.util.TimeOut;import org.junit.Before;-import org.junit.Rule;import org.junit.Test;-import org.junit.rules.TestRule;@ThreadLeakLingering(linger = 10)public class TestJaegerConfigurator extends SolrTestCaseJ4 {-- @Rule public TestRule solrTestRules = new SystemPropertiesRestoreRule();-@Beforepublic void doBefore() {// to be safe because this test tests tracing.diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrRules.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrRules.javaindex ea5ceecd6a4..a6e0b7416b2 100644--- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrRules.java+++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrRules.java@@ -104,8 +104,6 @@ class SolrRules {* Base class for planner rules that convert a relational expression to Solr calling convention.*/abstract static class SolrConverterRule extends ConverterRule {- final Convention out = SolrRel.CONVENTION;-SolrConverterRule(Class<? extends RelNode> clazz, String description) {this(clazz, relNode -> true, description);}diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/VMParamsAllAndReadonlyDigestZkACLProvider.java b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/VMParamsAllAndReadonlyDigestZkACLProvider.javaindex 744026ee808..6ddd1a98a18 100644--- a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/VMParamsAllAndReadonlyDigestZkACLProvider.java+++ b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/VMParamsAllAndReadonlyDigestZkACLProvider.java@@ -51,7 +51,6 @@ public class VMParamsAllAndReadonlyDigestZkACLProvider extends SecurityAwareZkACpublic static final String DEFAULT_DIGEST_FILE_VM_PARAM_NAME =VMParamsZkCredentialsInjector.DEFAULT_DIGEST_FILE_VM_PARAM_NAME;- private ZkCredentialsInjector zkCredentialsInjector;private DigestZkACLProvider digestZkACLProvider;public VMParamsAllAndReadonlyDigestZkACLProvider() {diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/VMParamsSingleSetCredentialsDigestZkCredentialsProvider.java b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/VMParamsSingleSetCredentialsDigestZkCredentialsProvider.javaindex d437e5b6682..0674a088616 100644--- a/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/VMParamsSingleSetCredentialsDigestZkCredentialsProvider.java+++ b/solr/solrj-zookeeper/src/java/org/apache/solr/common/cloud/VMParamsSingleSetCredentialsDigestZkCredentialsProvider.java@@ -35,7 +35,6 @@ public class VMParamsSingleSetCredentialsDigestZkCredentialsProviderpublic static final String DEFAULT_DIGEST_PASSWORD_VM_PARAM_NAME =VMParamsZkCredentialsInjector.DEFAULT_DIGEST_PASSWORD_VM_PARAM_NAME;- private ZkCredentialsInjector zkCredentialsInjector;private DigestZkCredentialsProvider digestZkCredentialsProvider;public VMParamsSingleSetCredentialsDigestZkCredentialsProvider() {diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.javaindex 53232cb485e..7388211fec5 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java@@ -16,7 +16,6 @@*/package org.apache.solr.client.solrj.embedded;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.io.File;import java.net.URL;import java.util.Locale;@@ -38,9 +37,6 @@ import org.eclipse.jetty.server.Server;import org.eclipse.jetty.server.ServerConnector;import org.eclipse.jetty.server.session.DefaultSessionIdManager;import org.eclipse.jetty.webapp.WebAppContext;-import org.junit.Rule;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;/*** @since solr 1.3@@ -49,8 +45,6 @@ public class JettyWebappTest extends SolrTestCaseJ4 {int port = 0;static final String context = "/test";- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-Server server;@Overridediff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServer.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServer.javaindex 3c8968dc37f..11415926d65 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServer.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestEmbeddedSolrServer.java@@ -16,22 +16,15 @@*/package org.apache.solr.client.solrj.embedded;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.io.IOException;import java.lang.invoke.MethodHandles;import java.util.ArrayList;import java.util.List;import org.apache.solr.core.SolrCore;-import org.junit.Rule;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;import org.slf4j.Logger;import org.slf4j.LoggerFactory;public class TestEmbeddedSolrServer extends AbstractEmbeddedSolrServerTestCase {-- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());@Overridediff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.javaindex 77667cf68cc..77a081cb602 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java@@ -16,7 +16,6 @@*/package org.apache.solr.client.solrj.embedded;-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;import java.lang.invoke.MethodHandles;import org.apache.solr.SolrTestCaseJ4;import org.apache.solr.client.solrj.SolrClient;@@ -27,10 +26,7 @@ import org.apache.solr.client.solrj.request.QueryRequest;import org.apache.solr.client.solrj.request.UpdateRequest;import org.apache.solr.client.solrj.response.CoreAdminResponse;import org.apache.solr.common.SolrInputDocument;-import org.junit.Rule;import org.junit.Test;-import org.junit.rules.RuleChain;-import org.junit.rules.TestRule;import org.slf4j.Logger;import org.slf4j.LoggerFactory;@@ -40,8 +36,6 @@ import org.slf4j.LoggerFactory;public class TestSolrProperties extends AbstractEmbeddedSolrServerTestCase {private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());- @Rule public TestRule solrTestRules = RuleChain.outerRule(new SystemPropertiesRestoreRule());-protected SolrClient getSolrAdmin() {return new EmbeddedSolrServer(cores, null);}diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.javaindex e60e3ab11e9..eb5ace81685 100644--- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java+++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractBasicDistributedZkTestBase.java@@ -97,14 +97,8 @@ public abstract class AbstractBasicDistributedZkTestBase extends AbstractFullDisprivate final boolean onlyLeaderIndexes = random().nextBoolean();- String t1 = "a_t";- String i1 = "a_i1";- String tlong = "other_tl1";String tsort = "t_sortable";- String oddField = "oddField_s";- String missingField = "ignore_exception__missing_but_valid_field_t";-private Map<String, List<SolrClient>> otherCollectionClients = new HashMap<>();private String oneInstanceCollection = "oneInstanceCollection";