You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by md...@apache.org on 2020/06/09 20:34:39 UTC
[lucene-solr] branch branch_8x updated: SOLR-14548 Address warning:
static member should be qualified by type name
This is an automated email from the ASF dual-hosted git repository.
mdrob pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/branch_8x by this push:
new 8ff8c16 SOLR-14548 Address warning: static member should be qualified by type name
8ff8c16 is described below
commit 8ff8c163555bac9cdf61fdda7589a15d2ad007f6
Author: Mike Drob <md...@apache.org>
AuthorDate: Mon Jun 8 11:33:03 2020 -0500
SOLR-14548 Address warning: static member should be qualified by type name
---
solr/CHANGES.txt | 2 +
.../client/solrj/embedded/JettySolrRunner.java | 6 +--
.../core/src/java/org/apache/solr/cloud/ZkCLI.java | 8 ++--
.../apache/solr/servlet/SolrRequestParsers.java | 2 +-
.../src/java/org/apache/solr/util/ExportTool.java | 49 +++++++++++-----------
.../org/apache/solr/BasicFunctionalityTest.java | 3 +-
.../core/snapshots/TestSolrCloudSnapshots.java | 2 +-
.../solr/handler/TestReplicationHandler.java | 2 +-
.../solr/response/TestGraphMLResponseWriter.java | 5 ++-
.../apache/solr/search/TestHashQParserPlugin.java | 21 +++++-----
.../org/apache/solr/search/facet/DebugAgg.java | 2 +-
.../security/JWTVerificationkeyResolverTest.java | 2 +-
.../client/solrj/io/graph/GraphExpressionTest.java | 5 ++-
.../src/java/org/apache/solr/SolrTestCaseJ4.java | 3 +-
.../solr/cloud/AbstractFullDistribZkTestBase.java | 2 +-
15 files changed, 59 insertions(+), 55 deletions(-)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 67201d7..8c2275f 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -244,6 +244,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.java
index aea2280..8b019c2 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.java
index 8a7f79f..575105b 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;
@@ -107,14 +106,13 @@ public class ZkCLI {
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.java
index 067e97c..52696ba 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.java
index f44e733..869d1e3 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.java
index 2928ab2..e73f3ee 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.java
index f0bae3b..41a10ca 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.java
index 8727b01..8fd2abb 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.java
index 72af04b..54b4654 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.java
index 6e529dc..fe9dbac 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 hash
params = 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.java
index ee23351..77bfb35 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, int 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.java
index 4b88787..998ec4a 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.java
index d98f886..8bb508c 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.java
index 0b12fcc..540ab3e 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -137,6 +137,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;
@@ -1004,7 +1005,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=" + results
diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java
index f96d882..ff35613 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
@@ -1069,7 +1069,7 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTes
protected void waitForRecoveriesToFinish(boolean verbose, int 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 {