Apache Solr open-source search software
SOLR-14548 Address warning: static member should be qualified by type… (#1555)
Mike Drob8ee6e6797b08
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex a02bd076910..788e15e41a7 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -317,6 +317,8 @@ Other Changes* SOLR-14545: Fix or suppress warnings in apache/solr/update (Erick Erickson)+* SOLR-14548: Address warning: static member should be qualified by type name (Mike Drob)+================== 8.5.2 ==================Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.diff --git a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.javaindex 5a17f4cf791..5a7dcd5c817 100644--- a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java+++ b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java@@ -172,20 +172,20 @@ public class JettySolrRunner {private void executeDelay() {int delayMs = 0;for (Delay delay: delays) {- this.log.info("Delaying {}, for reason: {}", delay.delayValue, delay.reason);+ log.info("Delaying {}, for reason: {}", delay.delayValue, delay.reason);if (delay.counter.decrementAndGet() == 0) {delayMs += delay.delayValue;}}if (delayMs > 0) {- this.log.info("Pausing this socket connection for {}ms...", delayMs);+ log.info("Pausing this socket connection for {}ms...", delayMs);try {Thread.sleep(delayMs);} catch (InterruptedException e) {throw new RuntimeException(e);}- this.log.info("Waking up after the delay of {}ms...", delayMs);+ log.info("Waking up after the delay of {}ms...", delayMs);}}diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java b/solr/core/src/java/org/apache/solr/cloud/ZkCLI.javaindex 5acd63bde6c..3ceb81d6d5c 100644--- a/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java+++ b/solr/core/src/java/org/apache/solr/cloud/ZkCLI.java@@ -34,7 +34,6 @@ import org.apache.commons.cli.CommandLine;import org.apache.commons.cli.CommandLineParser;import org.apache.commons.cli.HelpFormatter;import org.apache.commons.cli.Option;-import org.apache.commons.cli.OptionBuilder;import org.apache.commons.cli.Options;import org.apache.commons.cli.ParseException;import org.apache.commons.cli.PosixParser;@@ -108,14 +107,13 @@ public class ZkCLI implements CLIO {CommandLineParser parser = new PosixParser();Options options = new Options();-- options.addOption(OptionBuilder+ options.addOption(Option.builder(CMD).hasArg(true)- .withDescription(+ .desc("cmd to run: " + BOOTSTRAP + ", " + UPCONFIG + ", " + DOWNCONFIG+ ", " + LINKCONFIG + ", " + MAKEPATH + ", " + PUT + ", " + PUT_FILE + ","+ GET + "," + GET_FILE + ", " + LIST + ", " + CLEAR- + ", " + UPDATEACLS + ", " + LS).create(CMD));+ + ", " + UPDATEACLS + ", " + LS).build());Option zkHostOption = new Option("z", ZKHOST, true,"ZooKeeper host address");diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java b/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.javaindex 067e97c04d8..52696baba9e 100644--- a/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java+++ b/solr/core/src/java/org/apache/solr/servlet/SolrRequestParsers.java@@ -171,7 +171,7 @@ public class SolrRequestParsers {ArrayList<ContentStream> streams = new ArrayList<>(1);SolrParams params = parser.parseParamsAndFillStreams( req, streams );if (GlobalTracer.get().tracing()) {- GlobalTracer.get().getTracer().activeSpan().setTag("params", params.toString());+ GlobalTracer.getTracer().activeSpan().setTag("params", params.toString());}SolrQueryRequest sreq = buildRequestFrom(core, params, streams, getRequestTimer(req), req);diff --git a/solr/core/src/java/org/apache/solr/util/ExportTool.java b/solr/core/src/java/org/apache/solr/util/ExportTool.javaindex 43da84b0df4..963b0db4dda 100644--- a/solr/core/src/java/org/apache/solr/util/ExportTool.java+++ b/solr/core/src/java/org/apache/solr/util/ExportTool.java@@ -50,7 +50,6 @@ import java.util.zip.GZIPOutputStream;import com.google.common.collect.ImmutableSet;import org.apache.commons.cli.CommandLine;import org.apache.commons.cli.Option;-import org.apache.commons.cli.OptionBuilder;import org.apache.lucene.util.SuppressForbidden;import org.apache.solr.client.solrj.SolrQuery;import org.apache.solr.client.solrj.SolrRequest;@@ -214,36 +213,36 @@ public class ExportTool extends SolrCLI.ToolBase {}private static final Option[] OPTIONS = {- OptionBuilder+ Option.builder("url").hasArg()- .isRequired(true)- .withDescription("Address of the collection, example http://localhost:8983/solr/gettingstarted")- .create("url"),- OptionBuilder+ .required()+ .desc("Address of the collection, example http://localhost:8983/solr/gettingstarted")+ .build(),+ Option.builder("out").hasArg()- .isRequired(false)- .withDescription("file name . defaults to collection-name.<format>")- .create("out"),- OptionBuilder+ .required(false)+ .desc("file name . defaults to collection-name.<format>")+ .build(),+ Option.builder("format").hasArg()- .isRequired(false)- .withDescription("format json/javabin, default to json. file extension would be .json")- .create("format"),- OptionBuilder+ .required(false)+ .desc("format json/javabin, default to json. file extension would be .json")+ .build(),+ Option.builder("limit").hasArg()- .isRequired(false)- .withDescription("Max number of docs to download. default = 100, use -1 for all docs")- .create("limit"),- OptionBuilder+ .required(false)+ .desc("Max number of docs to download. default = 100, use -1 for all docs")+ .build(),+ Option.builder("query").hasArg()- .isRequired(false)- .withDescription("A custom query, default is *:*")- .create("query"),- OptionBuilder+ .required(false)+ .desc("A custom query, default is *:*")+ .build(),+ Option.builder("fields").hasArg()- .isRequired(false)- .withDescription("Comma separated fields. By default all fields are fetched")- .create("fields")+ .required(false)+ .desc("Comma separated fields. By default all fields are fetched")+ .build()};static class JsonSink extends DocsSink {diff --git a/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java b/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.javaindex 2928ab206dd..e73f3ee1e5b 100644--- a/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java+++ b/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java@@ -53,6 +53,7 @@ import org.apache.solr.schema.IndexSchemaFactory;import org.apache.solr.schema.SchemaField;import org.apache.solr.search.DocIterator;import org.apache.solr.search.DocList;+import org.apache.solr.util.BaseTestHarness;import org.junit.BeforeClass;import org.junit.Test;@@ -231,7 +232,7 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {,"//*[@numFound='0']");- assertU(h.simpleTag("rollback"));+ assertU(BaseTestHarness.simpleTag("rollback"));assertU(commit());}diff --git a/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.java b/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.javaindex 56c09884502..78b7ed3261a 100644--- a/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.java+++ b/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.java@@ -105,7 +105,7 @@ public class TestSolrCloudSnapshots extends SolrCloudTestCase {// Here the assumption is that Solr will spread the replicas uniformly across nodes.// If this is not true for some reason, then we will need to add some logic to find a// node with a single replica.- this.cluster.getRandomJetty(random()).stop();+ cluster.getRandomJetty(random()).stop();// Sleep a bit for allowing ZK watch to fire.Thread.sleep(5000);diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.javaindex 38512652fb3..97b3f0584b2 100644--- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java+++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java@@ -332,7 +332,7 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {List replicatedAtCount = (List) ((NamedList) details.get("slave")).get("indexReplicatedAtList");int tries = 0;while ((replicatedAtCount == null || replicatedAtCount.size() < i) && tries++ < 5) {- Thread.currentThread().sleep(1000);+ Thread.sleep(1000);details = getDetails(slaveClient);replicatedAtCount = (List) ((NamedList) details.get("slave")).get("indexReplicatedAtList");}diff --git a/solr/core/src/test/org/apache/solr/response/TestGraphMLResponseWriter.java b/solr/core/src/test/org/apache/solr/response/TestGraphMLResponseWriter.javaindex 72af04b23ae..54b4654a05e 100644--- a/solr/core/src/test/org/apache/solr/response/TestGraphMLResponseWriter.java+++ b/solr/core/src/test/org/apache/solr/response/TestGraphMLResponseWriter.java@@ -33,6 +33,7 @@ import org.apache.solr.client.solrj.io.stream.expr.StreamFactory;import org.apache.solr.client.solrj.io.Tuple;import org.apache.solr.client.solrj.io.stream.expr.Explanation;import org.apache.solr.request.SolrQueryRequest;+import org.apache.solr.util.BaseTestHarness;import org.junit.BeforeClass;import org.junit.Test;@@ -59,7 +60,7 @@ public class TestGraphMLResponseWriter extends SolrTestCaseJ4 {String graphML = writer.toString();//Validate the nodes- String error = h.validateXPath(graphML,+ String error = BaseTestHarness.validateXPath(graphML,"//graph/node[1][@id ='bill']","//graph/node[2][@id ='jim']","//graph/node[3][@id ='max']");@@ -67,7 +68,7 @@ public class TestGraphMLResponseWriter extends SolrTestCaseJ4 {throw new Exception(error);}//Validate the edges- error = h.validateXPath(graphML,+ error = BaseTestHarness.validateXPath(graphML,"//graph/edge[1][@source ='jim']","//graph/edge[1][@target ='bill']","//graph/edge[2][@source ='max']",diff --git a/solr/core/src/test/org/apache/solr/search/TestHashQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestHashQParserPlugin.javaindex 6e529dcab94..fe9dbace9c0 100644--- a/solr/core/src/test/org/apache/solr/search/TestHashQParserPlugin.java+++ b/solr/core/src/test/org/apache/solr/search/TestHashQParserPlugin.java@@ -20,6 +20,7 @@ import org.apache.lucene.util.LuceneTestCase;import org.apache.solr.SolrTestCaseJ4;import org.apache.solr.common.SolrException;import org.apache.solr.common.params.ModifiableSolrParams;+import org.apache.solr.util.BaseTestHarness;import org.junit.Before;import org.junit.BeforeClass;import org.junit.Test;@@ -65,7 +66,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {params.add("partitionKeys", "a_i,a_s,a_i,a_s");params.add("wt", "xml");String response = h.query(req(params));- h.validateXPath(response, "//*[@numFound='0']");+ BaseTestHarness.validateXPath(response, "//*[@numFound='0']");params = new ModifiableSolrParams();params.add("q", "*:*");@@ -103,7 +104,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {params.add("partitionKeys", "a_s");params.add("wt", "xml");String response = h.query(req(params));- h.validateXPath(response, "//*[@numFound='4']");+ BaseTestHarness.validateXPath(response, "//*[@numFound='4']");//Test with int hashparams = new ModifiableSolrParams();@@ -112,7 +113,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {params.add("partitionKeys", "a_i");params.add("wt", "xml");response = h.query(req(params));- h.validateXPath(response, "//*[@numFound='4']");+ BaseTestHarness.validateXPath(response, "//*[@numFound='4']");}@@ -153,7 +154,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {while(it.hasNext()) {String s = it.next();- String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");+ String results = BaseTestHarness.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");if(results == null) {set1.add(s);}@@ -172,7 +173,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {while(it.hasNext()) {String s = it.next();- String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");+ String results = BaseTestHarness.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");if(results == null) {set2.add(s);}@@ -192,7 +193,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {while(it.hasNext()) {String s = it.next();- String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");+ String results = BaseTestHarness.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");if(results == null) {set3.add(s);}@@ -223,7 +224,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {while(it.hasNext()) {String s = it.next();- String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");+ String results = BaseTestHarness.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");if(results == null) {set1.add(s);}@@ -242,7 +243,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {while(it.hasNext()) {String s = it.next();- String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");+ String results = BaseTestHarness.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");if(results == null) {set2.add(s);}@@ -270,7 +271,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {while(it.hasNext()) {String s = it.next();- String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");+ String results = BaseTestHarness.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");if(results == null) {set1.add(s);}@@ -289,7 +290,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {while(it.hasNext()) {String s = it.next();- String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");+ String results = BaseTestHarness.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");if(results == null) {set2.add(s);}diff --git a/solr/core/src/test/org/apache/solr/search/facet/DebugAgg.java b/solr/core/src/test/org/apache/solr/search/facet/DebugAgg.javaindex 0f63bf80e95..667932e8003 100644--- a/solr/core/src/test/org/apache/solr/search/facet/DebugAgg.java+++ b/solr/core/src/test/org/apache/solr/search/facet/DebugAgg.java@@ -96,7 +96,7 @@ class DebugAgg extends AggValueSource {public Acc(FacetContext fcontext, long numDocs, int numSlots, SlotAcc sub) {super(fcontext);- this.last = this;+ last = this;this.numDocs = numDocs;this.numSlots = numSlots;this.sub = sub;diff --git a/solr/core/src/test/org/apache/solr/security/JWTVerificationkeyResolverTest.java b/solr/core/src/test/org/apache/solr/security/JWTVerificationkeyResolverTest.javaindex 4b88787b0ea..998ec4a624b 100644--- a/solr/core/src/test/org/apache/solr/security/JWTVerificationkeyResolverTest.java+++ b/solr/core/src/test/org/apache/solr/security/JWTVerificationkeyResolverTest.java@@ -90,7 +90,7 @@ public class JWTVerificationkeyResolverTest extends SolrTestCaseJ4 {when(httpsJwksFactory.createList(anyList())).thenReturn(asList(firstJwkList, secondJwkList));JWTIssuerConfig issuerConfig = new JWTIssuerConfig("primary").setIss("foo").setJwksUrl(asList("url1", "url2"));- issuerConfig.setHttpsJwksFactory(httpsJwksFactory);+ JWTIssuerConfig.setHttpsJwksFactory(httpsJwksFactory);resolver = new JWTVerificationkeyResolver(Arrays.asList(issuerConfig), true);assumeWorkingMockito();diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/graph/GraphExpressionTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/graph/GraphExpressionTest.javaindex d98f8863188..8bb508c19bb 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/graph/GraphExpressionTest.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/graph/GraphExpressionTest.java@@ -59,6 +59,7 @@ import org.apache.solr.cloud.AbstractDistribZkTestBase;import org.apache.solr.cloud.SolrCloudTestCase;import org.apache.solr.common.params.ModifiableSolrParams;import org.apache.solr.common.util.NamedList;+import org.apache.solr.util.BaseTestHarness;import org.junit.Before;import org.junit.BeforeClass;import org.junit.Test;@@ -887,7 +888,7 @@ public class GraphExpressionTest extends SolrCloudTestCase {InputStreamReader reader = new InputStreamReader(stream, StandardCharsets.UTF_8);String xml = readString(reader);//Validate the nodes- String error = h.validateXPath(xml,+ String error = BaseTestHarness.validateXPath(xml,"//graph/node[1][@id ='jim']","//graph/node[2][@id ='max']","//graph/node[3][@id ='sam']");@@ -895,7 +896,7 @@ public class GraphExpressionTest extends SolrCloudTestCase {throw new Exception(error);}//Validate the edges- error = h.validateXPath(xml,+ error = BaseTestHarness.validateXPath(xml,"//graph/edge[1][@source ='bill']","//graph/edge[1][@target ='jim']","//graph/edge[2][@source ='bill']",diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.javaindex b94aca327a6..10317836d3d 100644--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java@@ -136,6 +136,7 @@ import org.apache.solr.servlet.DirectSolrConnection;import org.apache.solr.update.processor.DistributedUpdateProcessor;import org.apache.solr.update.processor.DistributedZkUpdateProcessor;import org.apache.solr.update.processor.UpdateRequestProcessor;+import org.apache.solr.util.BaseTestHarness;import org.apache.solr.util.ExternalPaths;import org.apache.solr.util.LogLevel;import org.apache.solr.util.RandomizeSSL;@@ -988,7 +989,7 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {tests = allTests;}- String results = h.validateXPath(response, tests);+ String results = BaseTestHarness.validateXPath(response, tests);if (null != results) {String msg = "REQUEST FAILED: xpath=" + resultsdiff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.javaindex 24c1fffff82..512cae58b77 100644--- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java+++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java@@ -1058,7 +1058,7 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTesprotected void waitForRecoveriesToFinish(boolean verbose, long timeoutSeconds)throws Exception {ZkStateReader zkStateReader = cloudClient.getZkStateReader();- super.waitForRecoveriesToFinish(DEFAULT_COLLECTION, zkStateReader, verbose, true, timeoutSeconds);+ waitForRecoveriesToFinish(DEFAULT_COLLECTION, zkStateReader, verbose, true, timeoutSeconds);}protected void checkQueries() throws Exception {