Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Oct 2, 2023
1 parent 285e356 commit 301c084
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
7 changes: 2 additions & 5 deletions solr/core/src/java/org/apache/solr/cli/AssertTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
* Supports assert command in the bin/solr script.
* Asserts various conditions and exists with error code if there are failures,
* else continues with no output.
* Supports assert command in the bin/solr script. Asserts various conditions and exists with error
* code if there are failures, else continues with no output.
*/

public class AssertTool extends ToolBase {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private static String message = null;
Expand Down
13 changes: 1 addition & 12 deletions solr/core/src/java/org/apache/solr/cli/SolrCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ private static void printHelp() {
*/
public static String normalizeSolrUrl(String solrUrl) {
if (solrUrl != null) {
if (solrUrl.indexOf("/solr") > -1) { //
if (solrUrl.contains("/solr")) { //
String newSolrUrl = solrUrl.substring(0, solrUrl.indexOf("/solr"));
CLIO.out(
"WARNING: URLs provided to this tool needn't include Solr's context-root (e.g. \"/solr\"). Such URLs are deprecated and support for them will be removed in a future release. Correcting from ["
Expand Down Expand Up @@ -575,17 +575,6 @@ public static String getZkHost(CommandLine cli) throws Exception {
return zkHost;
}

String solrUrl = cli.getOptionValue("solrUrl");
if (solrUrl == null) {
solrUrl = getDefaultSolrUrl();
CLIO.getOutStream()
.println(
"Neither -zkHost or -solrUrl parameters provided so assuming solrUrl is "
+ solrUrl
+ ".");
}
solrUrl = normalizeSolrUrl(solrUrl);

try (SolrClient solrClient = getSolrClient(cli)) {
// hit Solr to get system info
NamedList<Object> systemInfo =
Expand Down

0 comments on commit 301c084

Please sign in to comment.