SOLR-9079: Remove commons-lang as a dependency

Signed-off-by: Kevin Risden <krisden@apache.org>
This commit is contained in:
Kevin Risden 2019-03-19 15:04:00 -04:00
parent 14175c46d2
commit 6222abf448
No known key found for this signature in database
GPG Key ID: 040FAE3292C5F73F
62 changed files with 84 additions and 100 deletions

View File

@ -115,7 +115,7 @@ org.apache.calcite.version = 1.18.0
/org.apache.commons/commons-exec = 1.3
/org.apache.commons/commons-lang3 = 3.8.1
/org.apache.commons/commons-math3 = 3.6.1
/org.apache.commons/commons-text = 1.4
/org.apache.commons/commons-text = 1.6
org.apache.curator.version = 2.13.0
/org.apache.curator/curator-client = ${org.apache.curator.version}

View File

@ -137,6 +137,8 @@ Improvements
* SOLR-13227: Optimizing facet.range.other by avoiding expensive exceptions (Nikolay Khitrin via Mikhail Khludnev)
* SOLR-9079: Remove commons-lang as a dependency (Kevin Risden)
Other Changes
----------------------

View File

@ -34,7 +34,7 @@ import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.util.IOUtils;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.analytics.util.AnalyticsResponseHeadings;

View File

@ -25,7 +25,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexableField;
import org.apache.solr.common.SolrDocument;

View File

@ -27,11 +27,11 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set;
import java.util.function.Supplier;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.search.Query;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrDocumentList;
@ -388,7 +388,7 @@ public class CarrotClusteringEngine extends SearchClusteringEngine {
// Create a Carrot2 document
Document carrotDocument = new Document(getConcatenated(sdoc, titleFieldSpec),
snippet, ObjectUtils.toString(sdoc.getFieldValue(urlField), ""));
snippet, Objects.toString(sdoc.getFieldValue(urlField), ""));
// Store Solr id of the document, we need it to map document instances
// found in clusters back to identifiers.
@ -401,7 +401,7 @@ public class CarrotClusteringEngine extends SearchClusteringEngine {
// Use the first Carrot2-supported language
for (Object l : languages) {
String lang = ObjectUtils.toString(l, "");
String lang = Objects.toString(l, "");
if (languageCodeMap.containsKey(lang)) {
lang = languageCodeMap.get(lang);
@ -475,7 +475,7 @@ public class CarrotClusteringEngine extends SearchClusteringEngine {
// Join multiple values with a period so that Carrot2 does not pick up
// phrases that cross field value boundaries (in most cases it would
// create useless phrases).
result.append(ObjectUtils.toString(ite.next())).append(" . ");
result.append(Objects.toString(ite.next(), "")).append(" . ");
}
}
return result.toString().trim();

View File

@ -32,7 +32,6 @@ import java.util.SortedMap;
import java.util.TreeMap;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.util.ContentStream;
import org.apache.solr.common.util.ContentStreamBase;
@ -411,7 +410,7 @@ public class TestRerankBase extends RestTestBase {
}
loadModel(name, LinearModel.class.getCanonicalName(), features,
"{\"weights\":{" + StringUtils.join(weights, ",") + "}}");
"{\"weights\":{" + String.join(",", weights) + "}}");
}
protected static void bulkIndex() throws Exception {

View File

@ -24,6 +24,7 @@
</configurations>
<dependencies>
<dependency org="commons-collections" name="commons-collections" rev="${/commons-collections/commons-collections}" conf="compile"/>
<dependency org="commons-lang" name="commons-lang" rev="${/commons-lang/commons-lang}" conf="compile"/>
<dependency org="org.apache.velocity" name="velocity" rev="${/org.apache.velocity/velocity}" conf="compile"/>
<dependency org="org.apache.velocity" name="velocity-tools" rev="${/org.apache.velocity/velocity-tools}" conf="compile"/>

View File

@ -31,7 +31,6 @@ import java.util.Map;
import java.util.Properties;
import java.util.ResourceBundle;
import org.apache.commons.lang.StringUtils;
import org.apache.solr.client.solrj.SolrResponse;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.client.solrj.response.SolrResponseBase;
@ -338,7 +337,7 @@ public class VelocityResponseWriter implements QueryResponseWriter, SolrCoreAwar
loaders.add("builtin");
engine.setProperty("builtin.resource.loader.instance", new ClasspathResourceLoader());
engine.setProperty(RuntimeConstants.RESOURCE_LOADER, StringUtils.join(loaders,','));
engine.setProperty(RuntimeConstants.RESOURCE_LOADER, String.join(",", loaders));
engine.setProperty(RuntimeConstants.INPUT_ENCODING, "UTF-8");

View File

@ -35,7 +35,7 @@
<dependency org="org.apache.commons" name="commons-exec" rev="${/org.apache.commons/commons-exec}" conf="compile"/>
<dependency org="commons-fileupload" name="commons-fileupload" rev="${/commons-fileupload/commons-fileupload}" conf="compile"/>
<dependency org="commons-cli" name="commons-cli" rev="${/commons-cli/commons-cli}" conf="compile"/>
<dependency org="commons-lang" name="commons-lang" rev="${/commons-lang/commons-lang}" conf="compile"/>
<dependency org="org.apache.commons" name="commons-text" rev="${/org.apache.commons/commons-text}" conf="compile"/>
<dependency org="com.google.guava" name="guava" rev="${/com.google.guava/guava}" conf="compile"/>
<dependency org="org.locationtech.spatial4j" name="spatial4j" rev="${/org.locationtech.spatial4j/spatial4j}" conf="compile"/>
<dependency org="org.antlr" name="antlr4-runtime" rev="${/org.antlr/antlr4-runtime}"/>

View File

@ -28,7 +28,7 @@ import java.util.Map;
import java.util.Random;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.cloud.api.collections.OverseerCollectionMessageHandler;
import org.apache.solr.cloud.overseer.ClusterStateMutator;
import org.apache.solr.cloud.overseer.CollectionMutator;

View File

@ -53,7 +53,7 @@ import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicReference;
import com.google.common.base.Strings;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.client.solrj.cloud.SolrCloudManager;
import org.apache.solr.client.solrj.impl.CloudSolrClient;
import org.apache.solr.client.solrj.impl.HttpSolrClient;

View File

@ -32,7 +32,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.client.solrj.cloud.SolrCloudManager;
import org.apache.solr.client.solrj.cloud.autoscaling.PolicyHelper;
import org.apache.solr.cloud.ActiveReplicaWatcher;

View File

@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.client.solrj.SolrResponse;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.cloud.DistribStateManager;

View File

@ -27,7 +27,7 @@ import java.util.NoSuchElementException;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.client.solrj.cloud.DistribStateManager;
import org.apache.solr.client.solrj.cloud.SolrCloudManager;
import org.apache.solr.client.solrj.cloud.autoscaling.VersionedData;

View File

@ -32,7 +32,7 @@ import java.util.Properties;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.cloud.CloudDescriptor;
import org.apache.solr.common.SolrException;
import org.apache.solr.util.PropertiesUtil;

View File

@ -29,7 +29,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.Tokenizer;

View File

@ -38,7 +38,7 @@ import java.util.stream.Collectors;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.api.Api;
import org.apache.solr.client.solrj.SolrResponse;
import org.apache.solr.client.solrj.impl.HttpSolrClient;

View File

@ -28,7 +28,7 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.fs.Path;
import org.apache.solr.api.Api;
import org.apache.solr.client.solrj.SolrResponse;

View File

@ -28,7 +28,7 @@ import java.util.Map;
import java.util.concurrent.ExecutorService;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.api.Api;
import org.apache.solr.cloud.CloudDescriptor;
import org.apache.solr.cloud.ZkController;

View File

@ -23,7 +23,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.cloud.CloudDescriptor;
import org.apache.solr.cloud.ZkController;
import org.apache.solr.common.SolrException;

View File

@ -26,7 +26,7 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.cloud.LeaderElector;
import org.apache.solr.cloud.OverseerTaskProcessor;
import org.apache.solr.cloud.overseer.SliceMutator;

View File

@ -30,8 +30,8 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.FixedBitSet;
import org.apache.solr.client.solrj.util.ClientUtils;

View File

@ -38,7 +38,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.HttpClient;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrRequest;

View File

@ -28,7 +28,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.queries.function.FunctionQuery;
import org.apache.lucene.queries.function.ValueSource;

View File

@ -19,7 +19,7 @@ package org.apache.solr.request;
import java.util.function.Predicate;
import org.apache.lucene.util.BytesRef;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
/**
* An implementation of {@link Predicate} which returns true if the BytesRef contains a given substring.

View File

@ -32,7 +32,7 @@ import com.carrotsearch.hppc.IntIntHashMap;
import com.carrotsearch.hppc.IntLongHashMap;
import com.carrotsearch.hppc.cursors.IntIntCursor;
import com.carrotsearch.hppc.cursors.IntLongCursor;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.codecs.DocValuesProducer;
import org.apache.lucene.index.DocValues;
import org.apache.lucene.index.DocValuesType;

View File

@ -26,7 +26,7 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.lucene.index.ExitableDirectoryReader;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.queries.function.FunctionQuery;

View File

@ -22,7 +22,7 @@ import org.apache.solr.common.util.NamedList;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.handler.component.SearchHandler; // jdoc
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
/**
* <p>A QParserPlugin that acts like a "switch/case" statement.</p>

View File

@ -525,7 +525,7 @@ public class JWTAuthPlugin extends AuthenticationPlugin implements SpecProvider,
wwwAuthParams.add("error=\"" + responseError + "\"");
wwwAuthParams.add("error_description=\"" + message + "\"");
}
response.addHeader(HttpHeaders.WWW_AUTHENTICATE, org.apache.commons.lang.StringUtils.join(wwwAuthParams, ", "));
response.addHeader(HttpHeaders.WWW_AUTHENTICATE, String.join(", ", wwwAuthParams));
response.addHeader(AuthenticationPlugin.HTTP_HEADER_X_SOLR_AUTHDATA, generateAuthDataHeader());
response.sendError(httpCode, message);
log.info("JWT Authentication attempt failed: {}", message);

View File

@ -20,8 +20,6 @@ import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Locale;
import org.apache.commons.lang.NotImplementedException;
/**
* Wrapper for PrintWriter that delegates to constructor arg
*/
@ -55,7 +53,7 @@ public class PrintWriterWrapper extends PrintWriter {
@Override
protected void clearError() {
throw new NotImplementedException();
throw new UnsupportedOperationException();
}
@Override
@ -75,7 +73,7 @@ public class PrintWriterWrapper extends PrintWriter {
@Override
public PrintWriter format(String format, Object... args) {
throw new NotImplementedException("Forbidden API");
throw new UnsupportedOperationException("Forbidden API");
}
@Override
@ -130,7 +128,7 @@ public class PrintWriterWrapper extends PrintWriter {
@Override
public PrintWriter printf(String format, Object... args) {
throw new NotImplementedException("Forbidden API");
throw new UnsupportedOperationException("Forbidden API");
}
@Override
@ -185,7 +183,7 @@ public class PrintWriterWrapper extends PrintWriter {
@Override
protected void setError() {
throw new NotImplementedException();
throw new UnsupportedOperationException();
}
@Override

View File

@ -39,7 +39,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.Header;
import org.apache.http.HeaderIterator;
import org.apache.http.HttpEntity;

View File

@ -18,8 +18,8 @@ package org.apache.solr.servlet;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.CloseShieldOutputStream;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.core.CoreContainer;
import org.apache.solr.core.SolrCore;
@ -71,9 +71,9 @@ public final class LoadAdminUiServlet extends BaseSolrServlet {
"${version}"
};
String[] replace = new String[] {
StringEscapeUtils.escapeJavaScript(request.getContextPath()),
StringEscapeUtils.escapeJavaScript(CommonParams.CORES_HANDLER_PATH),
StringEscapeUtils.escapeJavaScript(pack.getSpecificationVersion())
StringEscapeUtils.escapeEcmaScript(request.getContextPath()),
StringEscapeUtils.escapeEcmaScript(CommonParams.CORES_HANDLER_PATH),
StringEscapeUtils.escapeEcmaScript(pack.getSpecificationVersion())
};
out.write( StringUtils.replaceEach(html, search, replace) );

View File

@ -54,7 +54,7 @@ import com.codahale.metrics.jvm.GarbageCollectorMetricSet;
import com.codahale.metrics.jvm.MemoryUsageGaugeSet;
import com.codahale.metrics.jvm.ThreadStatesGaugeSet;
import org.apache.commons.io.FileCleaningTracker;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.HttpClient;
import org.apache.lucene.util.Version;
import org.apache.solr.api.V2HttpCall;

View File

@ -16,7 +16,7 @@
*/
package org.apache.solr.update.processor;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.common.SolrInputField;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.core.SolrCore;

View File

@ -36,7 +36,7 @@ import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;
import org.apache.commons.lang.LocaleUtils;
import org.apache.commons.lang3.LocaleUtils;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.core.SolrCore;
@ -171,7 +171,7 @@ public class ParseDateFieldUpdateProcessorFactory extends FieldMutatingUpdatePro
if (null != localeParam) {
locale = LocaleUtils.toLocale(localeParam);
} else {
locale = LocaleUtils.toLocale("en_US"); // because well-known patterns assume this
locale = Locale.US; // because well-known patterns assume this
}
Object defaultTimeZoneParam = args.remove(DEFAULT_TIME_ZONE_PARAM);

View File

@ -16,7 +16,7 @@
*/
package org.apache.solr.update.processor;
import org.apache.commons.lang.LocaleUtils;
import org.apache.commons.lang3.LocaleUtils;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.core.SolrCore;
import org.apache.solr.schema.FieldType;

View File

@ -27,7 +27,6 @@ import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.update.*;
import org.apache.solr.util.plugin.SolrCoreAware;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.FilenameUtils;
@ -352,7 +351,7 @@ public class StatelessScriptUpdateProcessorFactory extends UpdateRequestProcesso
engines.addAll(f.getNames());
}
}
result = StringUtils.join(engines, ", ");
result = String.join(", ", engines);
} catch (RuntimeException e) {
/* :NOOP: */
}

View File

@ -19,7 +19,7 @@ package org.apache.solr.update.processor;
import java.util.UUID;
import java.util.Locale;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.SolrQueryResponse;

View File

@ -78,8 +78,7 @@ import org.apache.commons.exec.OS;
import org.apache.commons.exec.environment.EnvironmentUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.SystemUtils;
import org.apache.commons.lang3.SystemUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NoHttpResponseException;
@ -4093,8 +4092,7 @@ public class SolrCLI {
private void ensureArgumentIsValidBooleanIfPresent(CommandLine cli, String argName) {
if (cli.hasOption(argName)) {
final String value = cli.getOptionValue(argName);
final Boolean parsedBoolean = BooleanUtils.toBooleanObject(value);
if (parsedBoolean == null) {
if (Boolean.parseBoolean(value)) {
echo("Argument [" + argName + "] must be either true or false, but was [" + value + "]");
exit(1);
}

View File

@ -31,7 +31,7 @@ import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.Future;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.SolrTestCaseJ4.SuppressSSL;
import org.apache.solr.client.solrj.SolrClient;

View File

@ -39,7 +39,6 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.commons.lang.StringUtils;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.JSONTestUtil;
@ -540,7 +539,7 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
}
// any combination of replica alternatives should give same numDocs
String replicas = StringUtils.join(replicaAlts.toArray(), "|");
String replicas = String.join("|", replicaAlts);
query.set("shards", replicas);
numDocs = client.query(query).getResults().getNumFound();
assertTrue("numDocs < 0 for replicas "+replicas+" via "+client,
@ -571,11 +570,11 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
}
}
Collections.shuffle(replicas, random());
randomShards.add(StringUtils.join(replicas, "|"));
randomShards.add(String.join("|", replicas));
}
}
}
String randShards = StringUtils.join(randomShards, ",");
String randShards = String.join(",", randomShards);
query.set("shards", randShards);
for (SolrClient client : this.clients) {
assertEquals("numDocs for "+randShards+" via "+client,

View File

@ -25,7 +25,6 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.CloudSolrClient;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
@ -98,7 +97,7 @@ public class DistribJoinFromCollectionTest extends SolrCloudTestCase{
// deploy the "from" collection to all nodes where the "to" collection exists
CollectionAdminRequest.createCollection(fromColl, configName, 1, 4)
.setCreateNodeSet(StringUtils.join(nodeSet, ","))
.setCreateNodeSet(String.join(",", nodeSet))
.setProperties(collectionProperties)
.process(cluster.getSolrClient());

View File

@ -29,7 +29,7 @@ import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.request.UpdateRequest;

View File

@ -34,7 +34,7 @@ import java.util.stream.Collectors;
import com.codahale.metrics.Counter;
import com.codahale.metrics.Metric;
import com.codahale.metrics.MetricRegistry;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServerException;

View File

@ -17,7 +17,7 @@
package org.apache.solr.cloud;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
import org.apache.solr.SolrTestCaseJ4.SuppressSSL;

View File

@ -26,7 +26,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.lucene.util.TestUtil;
import org.apache.solr.SolrTestCaseJ4.SuppressSSL;
import org.apache.solr.client.solrj.SolrServerException;
@ -496,7 +495,7 @@ public class TestCloudPivotFacet extends AbstractFullDistribZkTestBase {
// makes it a robust test (especially for multi-valued fields)
fields[i] = fieldNames[TestUtil.nextInt(random(),0,fieldNames.length-1)];
}
return StringUtils.join(fields, ",");
return String.join(",", fields);
}
/**

View File

@ -27,7 +27,6 @@ import java.util.List;
import java.util.Map;
import java.util.Random;
import org.apache.commons.lang.StringUtils;
import org.apache.lucene.util.TestUtil;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
@ -732,7 +731,7 @@ public class TestCloudPseudoReturnFields extends SolrCloudTestCase {
Collections.shuffle(fl, random);
final SolrParams singleFl = params("q","*:*", "rows", "1","fl",StringUtils.join(fl.toArray(),','));
final SolrParams singleFl = params("q","*:*", "rows", "1","fl",String.join(",", fl));
final ModifiableSolrParams multiFl = params("q","*:*", "rows", "1");
for (String item : fl) {
multiFl.add("fl",item);
@ -767,7 +766,7 @@ public class TestCloudPseudoReturnFields extends SolrCloudTestCase {
Collections.shuffle(fl, random);
final SolrParams singleFl = params("fl",StringUtils.join(fl.toArray(),','));
final SolrParams singleFl = params("fl",String.join(",", fl));
final ModifiableSolrParams multiFl = params();
for (String item : fl) {
multiFl.add("fl",item);

View File

@ -20,7 +20,6 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.lang.StringUtils;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
@ -147,7 +146,7 @@ public class CollectionTooManyReplicasTest extends SolrCloudTestCase {
List<String> nodes = getAllNodeNames(collectionName);
CollectionAdminRequest.createShard(collectionName, "shard4")
.setNodeSet(StringUtils.join(nodes, ","))
.setNodeSet(String.join(",", nodes))
.process(cluster.getSolrClient());
// And just for yucks, insure we fail the "regular" one again.

View File

@ -16,7 +16,7 @@
*/
package org.apache.solr.cloud.api.collections;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.CloudSolrClient;
import org.apache.solr.client.solrj.request.QueryRequest;

View File

@ -30,7 +30,6 @@ import java.util.regex.Pattern;
import com.google.common.collect.ImmutableList;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CommonParams;
@ -736,7 +735,7 @@ public class TestLazyCores extends SolrTestCaseJ4 {
}
private static final String makePath(String... args) {
return StringUtils.join(args, File.separator);
return String.join(File.separator, args);
}
@Test

View File

@ -18,7 +18,7 @@ package org.apache.solr.handler;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.util.NamedList;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.ArrayUtils;
/**
* A base class for all analysis request handler tests.

View File

@ -16,7 +16,6 @@
*/
package org.apache.solr.handler;
import org.apache.commons.lang.ObjectUtils;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.util.ContentStreamBase;
@ -37,6 +36,7 @@ import java.io.IOException;
import java.io.StringReader;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Objects;
import java.util.Queue;
public class XmlUpdateRequestHandlerTest extends SolrTestCaseJ4 {
@ -223,10 +223,10 @@ public class XmlUpdateRequestHandlerTest extends SolrTestCaseJ4 {
DeleteUpdateCommand expected = deleteCommands.poll();
assertNotNull("Unexpected delete command: [" + cmd + "]", expected);
assertTrue("Expected [" + expected + "] but found [" + cmd + "]",
ObjectUtils.equals(expected.id, cmd.id) &&
ObjectUtils.equals(expected.query, cmd.query) &&
Objects.equals(expected.id, cmd.id) &&
Objects.equals(expected.query, cmd.query) &&
expected.commitWithin==cmd.commitWithin &&
ObjectUtils.equals(expected.getRoute(), cmd.getRoute()));
Objects.equals(expected.getRoute(), cmd.getRoute()));
}
}

View File

@ -17,7 +17,6 @@
package org.apache.solr.handler.component;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.solr.SolrJettyTestBase;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrQuery;
@ -187,7 +186,7 @@ public class DistributedDebugComponentTest extends SolrJettyTestBase {
} else if (random().nextBoolean()) {
shards.remove(shard2);
}
q.set("shards", StringUtils.join(shards, ","));
q.set("shards", String.join(",", shards));
List<String> debug = new ArrayList<String>(10);

View File

@ -32,8 +32,8 @@ import java.util.List;
import java.util.Map;
import java.util.TreeSet;
import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.CompareToBuilder;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.lucene.document.Document;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.params.CommonParams;

View File

@ -21,7 +21,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.SortedDocValuesField;

View File

@ -28,8 +28,6 @@ import org.apache.solr.schema.SchemaField;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.commons.lang.StringUtils;
import org.junit.Before;
import org.junit.BeforeClass;
@ -691,7 +689,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
Collections.shuffle(fl, random);
final SolrParams singleFl = params("q","*:*", "rows", "1","fl",StringUtils.join(fl.toArray(),','));
final SolrParams singleFl = params("q","*:*", "rows", "1","fl",String.join(",", fl));
final ModifiableSolrParams multiFl = params("q","*:*", "rows", "1");
for (String item : fl) {
multiFl.add("fl",item);
@ -725,7 +723,7 @@ public class TestPseudoReturnFields extends SolrTestCaseJ4 {
Collections.shuffle(fl, random);
final SolrParams singleFl = params("fl",StringUtils.join(fl.toArray(),','));
final SolrParams singleFl = params("fl",String.join(",", fl));
final ModifiableSolrParams multiFl = params();
for (String item : fl) {
multiFl.add("fl",item);

View File

@ -29,7 +29,6 @@ import java.util.Map;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.commons.lang.StringUtils;
import org.apache.lucene.util.TestUtil;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
@ -418,7 +417,7 @@ public class TestCloudJSONFacetJoinDomain extends SolrCloudTestCase {
// keep queries simple, just use str fields - not point of test
clauses.add(strfield(fieldNum) + ":" + randFieldValue(fieldNum));
}
return "(" + StringUtils.join(clauses, " OR ") + ")";
return "(" + String.join(" OR ", clauses) + ")";
}
/**

View File

@ -28,8 +28,6 @@ import java.util.Map;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.commons.lang.StringUtils;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.lucene.util.TestUtil;
import org.apache.solr.client.solrj.SolrClient;
@ -300,7 +298,7 @@ public class TestCloudJSONFacetSKG extends SolrCloudTestCase {
private static String buildORQuery(String... clauses) {
assert 0 < clauses.length;
return "(" + StringUtils.join(clauses, " OR ") + ")";
return "(" + String.join(" OR ", clauses) + ")";
}
/**

View File

@ -1 +0,0 @@
680b74de9c393bbf8d9e951af301659b16845907

View File

@ -0,0 +1 @@
ba72cf0c40cf701e972fe7720ae844629f4ecca2

View File

@ -22,7 +22,7 @@ import java.io.IOException;
import org.apache.solr.SolrTestCase;
import org.apache.solr.client.solrj.impl.HttpClientUtil.SchemaRegistryProvider;
import org.apache.commons.lang.reflect.FieldUtils;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.ssl.DefaultHostnameVerifier;
import org.apache.http.conn.ssl.NoopHostnameVerifier;

View File

@ -25,7 +25,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.util.RecordingJSONParser;