diff --git a/extensions-contrib/aliyun-oss-extensions/pom.xml b/extensions-contrib/aliyun-oss-extensions/pom.xml
index bffaed8c065d..82ee50eddf97 100644
--- a/extensions-contrib/aliyun-oss-extensions/pom.xml
+++ b/extensions-contrib/aliyun-oss-extensions/pom.xml
@@ -100,11 +100,6 @@
jsr305
provided
-
- commons-lang
- commons-lang
- provided
-
diff --git a/extensions-contrib/kubernetes-overlord-extensions/pom.xml b/extensions-contrib/kubernetes-overlord-extensions/pom.xml
index 90c29362e64b..55f970fb9c39 100644
--- a/extensions-contrib/kubernetes-overlord-extensions/pom.xml
+++ b/extensions-contrib/kubernetes-overlord-extensions/pom.xml
@@ -76,11 +76,6 @@
${project.parent.version}
provided
-
- commons-lang
- commons-lang
- provided
-
commons-io
commons-io
diff --git a/extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/MultiContainerTaskAdapter.java b/extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/MultiContainerTaskAdapter.java
index a81154a3bcba..f5f40be9af4a 100644
--- a/extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/MultiContainerTaskAdapter.java
+++ b/extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/MultiContainerTaskAdapter.java
@@ -33,7 +33,7 @@
import io.fabric8.kubernetes.api.model.VolumeMount;
import io.fabric8.kubernetes.api.model.VolumeMountBuilder;
import io.fabric8.kubernetes.api.model.batch.v1.Job;
-import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.text.StringEscapeUtils;
import org.apache.druid.indexing.common.config.TaskConfig;
import org.apache.druid.indexing.common.task.Task;
import org.apache.druid.k8s.overlord.KubernetesTaskRunnerConfig;
diff --git a/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapterTest.java b/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapterTest.java
index f8e7186a0263..c8c3739cf5af 100644
--- a/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapterTest.java
+++ b/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/taskadapter/K8sTaskAdapterTest.java
@@ -40,8 +40,8 @@
import io.fabric8.kubernetes.api.model.batch.v1.JobList;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.server.mock.EnableKubernetesMockClient;
-import org.apache.commons.lang.RandomStringUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.error.DruidException;
import org.apache.druid.indexing.common.TestUtils;
import org.apache.druid.indexing.common.config.TaskConfig;
diff --git a/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/taskadapter/PodTemplateTaskAdapterTest.java b/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/taskadapter/PodTemplateTaskAdapterTest.java
index b25f23a25ddc..098136dbffe3 100644
--- a/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/taskadapter/PodTemplateTaskAdapterTest.java
+++ b/extensions-contrib/kubernetes-overlord-extensions/src/test/java/org/apache/druid/k8s/overlord/taskadapter/PodTemplateTaskAdapterTest.java
@@ -28,7 +28,7 @@
import io.fabric8.kubernetes.api.model.VolumeBuilder;
import io.fabric8.kubernetes.api.model.batch.v1.Job;
import io.fabric8.kubernetes.api.model.batch.v1.JobBuilder;
-import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang3.RandomStringUtils;
import org.apache.druid.error.DruidException;
import org.apache.druid.indexing.common.TestUtils;
import org.apache.druid.indexing.common.config.TaskConfig;
diff --git a/extensions-contrib/redis-cache/pom.xml b/extensions-contrib/redis-cache/pom.xml
index 092ca366dd58..45536017c587 100644
--- a/extensions-contrib/redis-cache/pom.xml
+++ b/extensions-contrib/redis-cache/pom.xml
@@ -77,8 +77,8 @@
provided
- commons-lang
- commons-lang
+ org.apache.commons
+ commons-lang3
provided
diff --git a/extensions-contrib/redis-cache/src/main/java/org/apache/druid/client/cache/RedisCacheFactory.java b/extensions-contrib/redis-cache/src/main/java/org/apache/druid/client/cache/RedisCacheFactory.java
index 3f15f115681d..2ac5cbad9e09 100644
--- a/extensions-contrib/redis-cache/src/main/java/org/apache/druid/client/cache/RedisCacheFactory.java
+++ b/extensions-contrib/redis-cache/src/main/java/org/apache/druid/client/cache/RedisCacheFactory.java
@@ -19,7 +19,7 @@
package org.apache.druid.client.cache;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.java.util.common.IAE;
import redis.clients.jedis.ConnectionPoolConfig;
import redis.clients.jedis.HostAndPort;
diff --git a/extensions-core/avro-extensions/pom.xml b/extensions-core/avro-extensions/pom.xml
index 01b5b470e90e..d32a8fc0b3e7 100644
--- a/extensions-core/avro-extensions/pom.xml
+++ b/extensions-core/avro-extensions/pom.xml
@@ -217,8 +217,8 @@
provided
- commons-lang
- commons-lang
+ org.apache.commons
+ commons-lang3
provided
diff --git a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroValueInputFormat.java b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroValueInputFormat.java
index 97dcd876d2eb..569c0c869052 100644
--- a/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroValueInputFormat.java
+++ b/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/AvroValueInputFormat.java
@@ -22,7 +22,7 @@
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericRecord;
import org.apache.avro.mapreduce.AvroJob;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.java.util.common.logger.Logger;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
diff --git a/extensions-core/azure-extensions/pom.xml b/extensions-core/azure-extensions/pom.xml
index b8a7d5ace75a..f3120b60b368 100644
--- a/extensions-core/azure-extensions/pom.xml
+++ b/extensions-core/azure-extensions/pom.xml
@@ -131,11 +131,6 @@
jsr305
provided
-
- commons-lang
- commons-lang
- provided
-
org.apache.commons
commons-lang3
diff --git a/extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPusher.java b/extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPusher.java
index 1b48d10c315c..9ffd9cca33e5 100644
--- a/extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPusher.java
+++ b/extensions-core/azure-extensions/src/main/java/org/apache/druid/storage/azure/AzureDataSegmentPusher.java
@@ -73,7 +73,7 @@ public String getPathForHadoop(String dataSource)
public String getPathForHadoop()
{
String prefix = segmentConfig.getPrefix();
- boolean prefixIsNullOrEmpty = org.apache.commons.lang.StringUtils.isEmpty(prefix);
+ boolean prefixIsNullOrEmpty = org.apache.commons.lang3.StringUtils.isEmpty(prefix);
String hadoopPath = StringUtils.format(
"%s://%s@%s.%s/%s",
AzureUtils.AZURE_STORAGE_HADOOP_PROTOCOL,
@@ -129,7 +129,7 @@ public DataSegment push(final File indexFilesDir, final DataSegment segment, fin
public DataSegment pushToPath(File indexFilesDir, DataSegment segment, String storageDirSuffix) throws IOException
{
String prefix = segmentConfig.getPrefix();
- boolean prefixIsNullOrEmpty = org.apache.commons.lang.StringUtils.isEmpty(prefix);
+ boolean prefixIsNullOrEmpty = org.apache.commons.lang3.StringUtils.isEmpty(prefix);
final String azurePath = JOINER.join(
prefixIsNullOrEmpty ? null : StringUtils.maybeRemoveTrailingSlash(prefix),
storageDirSuffix
diff --git a/extensions-core/google-extensions/pom.xml b/extensions-core/google-extensions/pom.xml
index ae0fde8f9fb3..39f89a2e5a53 100644
--- a/extensions-core/google-extensions/pom.xml
+++ b/extensions-core/google-extensions/pom.xml
@@ -57,12 +57,6 @@
commons-io
provided
-
- commons-lang
- commons-lang
- 2.6
- provided
-
com.fasterxml.jackson.core
jackson-annotations
diff --git a/extensions-core/hdfs-storage/pom.xml b/extensions-core/hdfs-storage/pom.xml
index 058327e3c648..ac8f7878e5d6 100644
--- a/extensions-core/hdfs-storage/pom.xml
+++ b/extensions-core/hdfs-storage/pom.xml
@@ -94,8 +94,8 @@
provided
- commons-lang
- commons-lang
+ org.apache.commons
+ commons-lang3
provided
diff --git a/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java b/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java
index ba150bef3eb6..7802d88331c7 100644
--- a/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java
+++ b/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java
@@ -22,7 +22,7 @@
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.inject.Inject;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.guice.Hdfs;
import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.emitter.EmittingLogger;
diff --git a/extensions-core/multi-stage-query/pom.xml b/extensions-core/multi-stage-query/pom.xml
index 993d3a44853a..ef4aeb1c84ec 100644
--- a/extensions-core/multi-stage-query/pom.xml
+++ b/extensions-core/multi-stage-query/pom.xml
@@ -196,11 +196,6 @@
fastutil-core
provided
-
- commons-lang
- commons-lang
- provided
-
commons-io
commons-io
diff --git a/extensions-core/s3-extensions/pom.xml b/extensions-core/s3-extensions/pom.xml
index 26ce68e4931c..b50d9c01a9e0 100644
--- a/extensions-core/s3-extensions/pom.xml
+++ b/extensions-core/s3-extensions/pom.xml
@@ -93,8 +93,8 @@
provided
- commons-lang
- commons-lang
+ org.apache.commons
+ commons-lang3
provided
diff --git a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3StorageDruidModule.java b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3StorageDruidModule.java
index 3747088aeb6e..2df1cb5179bb 100644
--- a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3StorageDruidModule.java
+++ b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3StorageDruidModule.java
@@ -34,7 +34,7 @@
import com.google.inject.Binder;
import com.google.inject.Provides;
import com.google.inject.multibindings.MapBinder;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.common.aws.AWSClientConfig;
import org.apache.druid.common.aws.AWSEndpointConfig;
import org.apache.druid.common.aws.AWSProxyConfig;
diff --git a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3Utils.java b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3Utils.java
index c41878ce51e1..ecea31c94f74 100644
--- a/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3Utils.java
+++ b/extensions-core/s3-extensions/src/main/java/org/apache/druid/storage/s3/S3Utils.java
@@ -379,7 +379,7 @@ public static Protocol determineProtocol(AWSClientConfig clientConfig, AWSEndpoi
{
final Protocol protocolFromClientConfig = parseProtocol(clientConfig.getProtocol());
final String endpointUrl = endpointConfig.getUrl();
- if (org.apache.commons.lang.StringUtils.isNotEmpty(endpointUrl)) {
+ if (org.apache.commons.lang3.StringUtils.isNotEmpty(endpointUrl)) {
//noinspection ConstantConditions
final URI uri = URIs.parse(endpointUrl, protocolFromClientConfig.toString());
final Protocol protocol = parseProtocol(uri.getScheme());
@@ -394,16 +394,16 @@ public static Protocol determineProtocol(AWSClientConfig clientConfig, AWSEndpoi
public static ClientConfiguration setProxyConfig(ClientConfiguration conf, AWSProxyConfig proxyConfig)
{
- if (org.apache.commons.lang.StringUtils.isNotEmpty(proxyConfig.getHost())) {
+ if (org.apache.commons.lang3.StringUtils.isNotEmpty(proxyConfig.getHost())) {
conf.setProxyHost(proxyConfig.getHost());
}
if (proxyConfig.getPort() != -1) {
conf.setProxyPort(proxyConfig.getPort());
}
- if (org.apache.commons.lang.StringUtils.isNotEmpty(proxyConfig.getUsername())) {
+ if (org.apache.commons.lang3.StringUtils.isNotEmpty(proxyConfig.getUsername())) {
conf.setProxyUsername(proxyConfig.getUsername());
}
- if (org.apache.commons.lang.StringUtils.isNotEmpty(proxyConfig.getPassword())) {
+ if (org.apache.commons.lang3.StringUtils.isNotEmpty(proxyConfig.getPassword())) {
conf.setProxyPassword(proxyConfig.getPassword());
}
return conf;
diff --git a/indexing-service/pom.xml b/indexing-service/pom.xml
index a9479d7db082..4bc044182f5a 100644
--- a/indexing-service/pom.xml
+++ b/indexing-service/pom.xml
@@ -92,10 +92,6 @@
com.google.inject.extensions
guice-multibindings
-
- commons-lang
- commons-lang
-
javax.ws.rs
jsr311-api
diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/HadoopIndexTask.java b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/HadoopIndexTask.java
index f1f96d8ca34d..3babcdd73683 100644
--- a/indexing-service/src/main/java/org/apache/druid/indexing/common/task/HadoopIndexTask.java
+++ b/indexing-service/src/main/java/org/apache/druid/indexing/common/task/HadoopIndexTask.java
@@ -31,7 +31,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
-import org.apache.commons.lang.BooleanUtils;
+import org.apache.commons.lang3.BooleanUtils;
import org.apache.druid.indexer.DataSegmentAndIndexZipFilePath;
import org.apache.druid.indexer.HadoopDruidDetermineConfigurationJob;
import org.apache.druid.indexer.HadoopDruidIndexerConfig;
diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/RemoteTaskRunner.java b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/RemoteTaskRunner.java
index a79c263ec40c..8ef718e97bee 100644
--- a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/RemoteTaskRunner.java
+++ b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/RemoteTaskRunner.java
@@ -40,7 +40,7 @@
import com.google.common.util.concurrent.ListeningScheduledExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
-import org.apache.commons.lang.mutable.MutableInt;
+import org.apache.commons.lang3.mutable.MutableInt;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.cache.PathChildrenCache;
import org.apache.curator.framework.recipes.cache.PathChildrenCacheListener;
diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisorStateManager.java b/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisorStateManager.java
index 5b41fc2a9df1..df46aa78d53c 100644
--- a/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisorStateManager.java
+++ b/indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisorStateManager.java
@@ -20,7 +20,7 @@
package org.apache.druid.indexing.seekablestream.supervisor;
import com.fasterxml.jackson.annotation.JsonProperty;
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.druid.indexing.overlord.supervisor.SupervisorStateManager;
import org.apache.druid.indexing.overlord.supervisor.SupervisorStateManagerConfig;
import org.apache.druid.indexing.seekablestream.common.StreamException;
diff --git a/indexing-service/src/test/java/org/apache/druid/indexing/input/DruidSegmentReaderTest.java b/indexing-service/src/test/java/org/apache/druid/indexing/input/DruidSegmentReaderTest.java
index 767f2b3ebab7..5dcc11c9f1c5 100644
--- a/indexing-service/src/test/java/org/apache/druid/indexing/input/DruidSegmentReaderTest.java
+++ b/indexing-service/src/test/java/org/apache/druid/indexing/input/DruidSegmentReaderTest.java
@@ -22,7 +22,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
-import org.apache.commons.lang.mutable.MutableBoolean;
+import org.apache.commons.lang3.mutable.MutableBoolean;
import org.apache.druid.data.input.BytesCountingInputEntity;
import org.apache.druid.data.input.ColumnsFilter;
import org.apache.druid.data.input.InputEntity;
diff --git a/pom.xml b/pom.xml
index 2a5d6d902124..61d50ee3abed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -508,6 +508,10 @@
com.google.guava
guava
+
+ net.hydromatic
+ aggdesigner-algorithm
+
@@ -1397,6 +1401,11 @@
rewrite-testing-frameworks
2.6.0
+
+ org.openrewrite.recipe
+ rewrite-apache
+ 1.2.2
+
diff --git a/processing/pom.xml b/processing/pom.xml
index 7ae4cc075a20..910302c0b818 100644
--- a/processing/pom.xml
+++ b/processing/pom.xml
@@ -74,8 +74,8 @@
commons-io
- commons-lang
- commons-lang
+ org.apache.commons
+ commons-lang3
org.apache.commons
@@ -422,11 +422,6 @@
hamcrest-core
test
-
- org.apache.commons
- commons-lang3
- test
-
org.slf4j
slf4j-simple
diff --git a/processing/src/main/java/org/apache/druid/data/input/impl/CloudObjectInputSource.java b/processing/src/main/java/org/apache/druid/data/input/impl/CloudObjectInputSource.java
index 6e6ceda47c2d..6e9587ca0d7e 100644
--- a/processing/src/main/java/org/apache/druid/data/input/impl/CloudObjectInputSource.java
+++ b/processing/src/main/java/org/apache/druid/data/input/impl/CloudObjectInputSource.java
@@ -24,7 +24,7 @@
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import com.google.common.primitives.Ints;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.data.input.AbstractInputSource;
import org.apache.druid.data.input.FilePerSplitHintSpec;
import org.apache.druid.data.input.InputEntity;
diff --git a/processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java b/processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java
index 1bd008d5378b..02ee545ba814 100644
--- a/processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java
+++ b/processing/src/main/java/org/apache/druid/frame/read/columnar/StringFrameColumnReader.java
@@ -20,7 +20,7 @@
package org.apache.druid.frame.read.columnar;
import com.google.common.primitives.Ints;
-import org.apache.commons.lang.ObjectUtils;
+import org.apache.commons.lang3.ObjectUtils;
import org.apache.datasketches.memory.Memory;
import org.apache.druid.common.config.NullHandling;
import org.apache.druid.error.DruidException;
diff --git a/processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java b/processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java
index e5d9b2c8e4ec..d8ef9956d9bf 100644
--- a/processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java
+++ b/processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java
@@ -824,4 +824,13 @@ public static String getResource(Object ref, String resource)
throw new ISE(e, "Cannot load resource: [%s]", resource);
}
}
+
+ /**
+ This method is removed from commons lang3.
+ https://commons.apache.org/proper/commons-lang/article3_0.html
+ */
+ public static String escapeSql(String str)
+ {
+ return str == null ? null : StringUtils.replace(str, "'", "''");
+ }
}
diff --git a/processing/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java b/processing/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java
index 15146106edc0..072d75ced7bd 100644
--- a/processing/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java
+++ b/processing/src/main/java/org/apache/druid/java/util/common/lifecycle/Lifecycle.java
@@ -21,7 +21,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.common.logger.Logger;
diff --git a/processing/src/main/java/org/apache/druid/java/util/common/parsers/ParserUtils.java b/processing/src/main/java/org/apache/druid/java/util/common/parsers/ParserUtils.java
index b716737d15e9..18afba4491d9 100644
--- a/processing/src/main/java/org/apache/druid/java/util/common/parsers/ParserUtils.java
+++ b/processing/src/main/java/org/apache/druid/java/util/common/parsers/ParserUtils.java
@@ -24,7 +24,7 @@
import com.google.common.base.Splitter;
import com.google.common.primitives.Doubles;
import com.google.common.primitives.Longs;
-import org.apache.commons.lang.math.NumberUtils;
+import org.apache.commons.lang3.math.NumberUtils;
import org.apache.druid.common.config.NullHandling;
import org.joda.time.DateTimeZone;
@@ -95,7 +95,7 @@ public static Function getTransformationFunction(
@Nullable
private static Object tryParseStringAsNumber(@Nullable final String input)
{
- if (!NumberUtils.isNumber(input)) {
+ if (!NumberUtils.isCreatable(input)) {
return NullHandling.emptyToNullIfNeeded(input);
}
diff --git a/processing/src/main/java/org/apache/druid/math/expr/ConstantExpr.java b/processing/src/main/java/org/apache/druid/math/expr/ConstantExpr.java
index 8f708c95361b..9d3c847e2089 100644
--- a/processing/src/main/java/org/apache/druid/math/expr/ConstantExpr.java
+++ b/processing/src/main/java/org/apache/druid/math/expr/ConstantExpr.java
@@ -21,7 +21,7 @@
import com.google.common.base.Preconditions;
import com.google.errorprone.annotations.Immutable;
-import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.text.StringEscapeUtils;
import org.apache.druid.common.config.NullHandling;
import org.apache.druid.java.util.common.IAE;
import org.apache.druid.java.util.common.StringUtils;
@@ -427,7 +427,7 @@ public ExprVectorProcessor asVectorProcessor(VectorInputBindingInspector
public String stringify()
{
// escape as javascript string since string literals are wrapped in single quotes
- return value == null ? NULL_LITERAL : StringUtils.format("'%s'", StringEscapeUtils.escapeJavaScript(value));
+ return value == null ? NULL_LITERAL : StringUtils.format("'%s'", StringEscapeUtils.escapeEcmaScript(value));
}
@Override
@@ -482,7 +482,7 @@ public String stringify()
.map(s -> s == null
? NULL_LITERAL
// escape as javascript string since string literals are wrapped in single quotes
- : StringUtils.format("'%s'", StringEscapeUtils.escapeJavaScript((String) s))
+ : StringUtils.format("'%s'", StringEscapeUtils.escapeEcmaScript((String) s))
)
.iterator()
)
diff --git a/processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java b/processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java
index 1f11b21a9134..b2aaeadf2146 100644
--- a/processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java
+++ b/processing/src/main/java/org/apache/druid/math/expr/ExprListenerImpl.java
@@ -21,7 +21,7 @@
import org.antlr.v4.runtime.tree.ParseTree;
import org.antlr.v4.runtime.tree.TerminalNode;
-import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.text.StringEscapeUtils;
import org.apache.druid.annotations.UsedInGeneratedCode;
import org.apache.druid.java.util.common.Numbers;
import org.apache.druid.java.util.common.RE;
diff --git a/processing/src/main/java/org/apache/druid/math/expr/IdentifierExpr.java b/processing/src/main/java/org/apache/druid/math/expr/IdentifierExpr.java
index ef222cda61f9..137fd93f5010 100644
--- a/processing/src/main/java/org/apache/druid/math/expr/IdentifierExpr.java
+++ b/processing/src/main/java/org/apache/druid/math/expr/IdentifierExpr.java
@@ -19,7 +19,7 @@
package org.apache.druid.math.expr;
-import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.text.StringEscapeUtils;
import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.math.expr.vector.ExprVectorProcessor;
import org.apache.druid.math.expr.vector.VectorProcessors;
diff --git a/processing/src/main/java/org/apache/druid/query/UnionQueryRunner.java b/processing/src/main/java/org/apache/druid/query/UnionQueryRunner.java
index 5459e1d8c22e..07b761138f4d 100644
--- a/processing/src/main/java/org/apache/druid/query/UnionQueryRunner.java
+++ b/processing/src/main/java/org/apache/druid/query/UnionQueryRunner.java
@@ -22,7 +22,7 @@
import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.common.Pair;
import org.apache.druid.java.util.common.guava.MergeSequence;
diff --git a/processing/src/main/java/org/apache/druid/query/expression/ContainsExpr.java b/processing/src/main/java/org/apache/druid/query/expression/ContainsExpr.java
index c11d783db1db..360888092a9b 100644
--- a/processing/src/main/java/org/apache/druid/query/expression/ContainsExpr.java
+++ b/processing/src/main/java/org/apache/druid/query/expression/ContainsExpr.java
@@ -97,7 +97,7 @@ private static Function createFunction(String searchString, boo
if (caseSensitive) {
return s -> s.contains(searchString);
} else {
- return s -> org.apache.commons.lang.StringUtils.containsIgnoreCase(s, searchString);
+ return s -> org.apache.commons.lang3.StringUtils.containsIgnoreCase(s, searchString);
}
}
}
diff --git a/processing/src/main/java/org/apache/druid/query/search/ContainsSearchQuerySpec.java b/processing/src/main/java/org/apache/druid/query/search/ContainsSearchQuerySpec.java
index 95c2bf57d1a2..79fd034616b3 100644
--- a/processing/src/main/java/org/apache/druid/query/search/ContainsSearchQuerySpec.java
+++ b/processing/src/main/java/org/apache/druid/query/search/ContainsSearchQuerySpec.java
@@ -68,7 +68,7 @@ public boolean accept(@Nullable String dimVal)
if (caseSensitive) {
return dimVal.contains(value);
}
- return org.apache.commons.lang.StringUtils.containsIgnoreCase(dimVal, value);
+ return org.apache.commons.lang3.StringUtils.containsIgnoreCase(dimVal, value);
}
@Override
diff --git a/processing/src/main/java/org/apache/druid/query/search/FragmentSearchQuerySpec.java b/processing/src/main/java/org/apache/druid/query/search/FragmentSearchQuerySpec.java
index dfdfb7072079..8f0e53807a76 100644
--- a/processing/src/main/java/org/apache/druid/query/search/FragmentSearchQuerySpec.java
+++ b/processing/src/main/java/org/apache/druid/query/search/FragmentSearchQuerySpec.java
@@ -85,7 +85,7 @@ public boolean accept(@Nullable String dimVal)
return containsAny(target, dimVal);
}
for (String search : target) {
- if (!org.apache.commons.lang.StringUtils.containsIgnoreCase(dimVal, search)) {
+ if (!org.apache.commons.lang3.StringUtils.containsIgnoreCase(dimVal, search)) {
return false;
}
}
diff --git a/processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQuery.java b/processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQuery.java
index 88d488f85b9c..4d98ccd9b219 100644
--- a/processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQuery.java
+++ b/processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQuery.java
@@ -26,7 +26,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Ordering;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.java.util.common.granularity.Granularity;
import org.apache.druid.query.BaseQuery;
import org.apache.druid.query.DataSource;
diff --git a/processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java b/processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java
index 18bcc713dece..4e06da817ce7 100644
--- a/processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java
+++ b/processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java
@@ -29,7 +29,7 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.inject.Inject;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.data.input.MapBasedRow;
import org.apache.druid.frame.Frame;
import org.apache.druid.frame.allocation.MemoryAllocatorFactory;
diff --git a/processing/src/main/java/org/apache/druid/segment/data/CompressionStrategy.java b/processing/src/main/java/org/apache/druid/segment/data/CompressionStrategy.java
index 96550329a84c..18ea27cc4044 100644
--- a/processing/src/main/java/org/apache/druid/segment/data/CompressionStrategy.java
+++ b/processing/src/main/java/org/apache/druid/segment/data/CompressionStrategy.java
@@ -27,7 +27,7 @@
import com.ning.compress.lzf.LZFEncoder;
import net.jpountz.lz4.LZ4Factory;
import net.jpountz.lz4.LZ4SafeDecompressor;
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang3.ArrayUtils;
import org.apache.druid.collections.ResourceHolder;
import org.apache.druid.java.util.common.ByteBufferUtils;
import org.apache.druid.java.util.common.StringUtils;
diff --git a/processing/src/main/java/org/apache/druid/tasklogs/TaskPayloadManager.java b/processing/src/main/java/org/apache/druid/tasklogs/TaskPayloadManager.java
index 41db8e4556b2..9ea7615789ea 100644
--- a/processing/src/main/java/org/apache/druid/tasklogs/TaskPayloadManager.java
+++ b/processing/src/main/java/org/apache/druid/tasklogs/TaskPayloadManager.java
@@ -20,7 +20,7 @@
package org.apache.druid.tasklogs;
import com.google.common.base.Optional;
-import org.apache.commons.lang.NotImplementedException;
+import org.apache.commons.lang3.NotImplementedException;
import org.apache.druid.guice.annotations.ExtensionPoint;
import org.apache.druid.java.util.common.StringUtils;
diff --git a/processing/src/test/java/org/apache/druid/java/util/common/logger/LoggerTest.java b/processing/src/test/java/org/apache/druid/java/util/common/logger/LoggerTest.java
index 3fce46638fbc..e5b7ea287dbd 100644
--- a/processing/src/test/java/org/apache/druid/java/util/common/logger/LoggerTest.java
+++ b/processing/src/test/java/org/apache/druid/java/util/common/logger/LoggerTest.java
@@ -19,7 +19,7 @@
package org.apache.druid.java.util.common.logger;
-import org.apache.commons.lang.mutable.MutableInt;
+import org.apache.commons.lang3.mutable.MutableInt;
import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.timeline.DataSegment;
@@ -125,7 +125,7 @@ public void testLogSegmentsMany()
Logger.logSegmentIds(logger, segments, "Many segments");
final int expected = (int) Math.ceil((double) numSegments / Logger.SEGMENTS_PER_LOG_MESSAGE);
- Assert.assertEquals(expected, msgCount.getValue());
+ Assert.assertEquals(expected, msgCount.intValue());
}
@Test
diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/constant/LongConstantAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/constant/LongConstantAggregatorTest.java
index d4f8b02220bf..e0658eb6b83c 100644
--- a/processing/src/test/java/org/apache/druid/query/aggregation/constant/LongConstantAggregatorTest.java
+++ b/processing/src/test/java/org/apache/druid/query/aggregation/constant/LongConstantAggregatorTest.java
@@ -19,7 +19,7 @@
package org.apache.druid.query.aggregation.constant;
-import org.apache.commons.lang.math.RandomUtils;
+import org.apache.commons.lang3.RandomUtils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -52,7 +52,7 @@ public void testAggregate()
@Test
public void testFloat()
{
- Assert.assertEquals((float) randomVal, aggregator.getFloat(), 0.0001f);
+ Assert.assertEquals(randomVal, aggregator.getFloat(), 0.0001f);
}
@Test
diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/constant/LongConstantBufferAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/constant/LongConstantBufferAggregatorTest.java
index 845d2c825b82..6054f99f6675 100644
--- a/processing/src/test/java/org/apache/druid/query/aggregation/constant/LongConstantBufferAggregatorTest.java
+++ b/processing/src/test/java/org/apache/druid/query/aggregation/constant/LongConstantBufferAggregatorTest.java
@@ -19,7 +19,7 @@
package org.apache.druid.query.aggregation.constant;
-import org.apache.commons.lang.math.RandomUtils;
+import org.apache.commons.lang3.RandomUtils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -57,7 +57,7 @@ public void testAggregate()
@Test
public void testFloat()
{
- Assert.assertEquals((float) randomVal, aggregator.getFloat(byteBuffer, 0), 0.0001f);
+ Assert.assertEquals(randomVal, aggregator.getFloat(byteBuffer, 0), 0.0001f);
}
@Test
diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/constant/LongConstantVectorAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/constant/LongConstantVectorAggregatorTest.java
index 6159ea6a28b8..ff97e0cf1404 100644
--- a/processing/src/test/java/org/apache/druid/query/aggregation/constant/LongConstantVectorAggregatorTest.java
+++ b/processing/src/test/java/org/apache/druid/query/aggregation/constant/LongConstantVectorAggregatorTest.java
@@ -19,7 +19,7 @@
package org.apache.druid.query.aggregation.constant;
-import org.apache.commons.lang.math.RandomUtils;
+import org.apache.commons.lang3.RandomUtils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
diff --git a/processing/src/test/java/org/apache/druid/query/scan/MultiSegmentScanQueryTest.java b/processing/src/test/java/org/apache/druid/query/scan/MultiSegmentScanQueryTest.java
index e3ea3b1ef6d2..1ac4fff834b3 100644
--- a/processing/src/test/java/org/apache/druid/query/scan/MultiSegmentScanQueryTest.java
+++ b/processing/src/test/java/org/apache/druid/query/scan/MultiSegmentScanQueryTest.java
@@ -23,7 +23,7 @@
import com.google.common.collect.Lists;
import com.google.common.io.CharSource;
import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.concurrent.Execs;
diff --git a/processing/src/test/java/org/apache/druid/query/scan/ScanQueryRunnerTest.java b/processing/src/test/java/org/apache/druid/query/scan/ScanQueryRunnerTest.java
index 7693f05471ff..7d88d5decfa6 100644
--- a/processing/src/test/java/org/apache/druid/query/scan/ScanQueryRunnerTest.java
+++ b/processing/src/test/java/org/apache/druid/query/scan/ScanQueryRunnerTest.java
@@ -29,7 +29,7 @@
import com.google.common.hash.Hashing;
import com.google.common.io.CharSource;
import com.google.common.io.LineProcessor;
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang3.ArrayUtils;
import org.apache.druid.common.config.NullHandling;
import org.apache.druid.hll.HyperLogLogCollector;
import org.apache.druid.java.util.common.DateTimes;
diff --git a/processing/src/test/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryRunnerTest.java b/processing/src/test/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryRunnerTest.java
index 6b1ee55568fd..d5cafdbb3423 100644
--- a/processing/src/test/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryRunnerTest.java
+++ b/processing/src/test/java/org/apache/druid/query/timeboundary/TimeBoundaryQueryRunnerTest.java
@@ -23,7 +23,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.google.common.io.CharSource;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.java.util.common.UOE;
diff --git a/processing/src/test/java/org/apache/druid/tasklogs/TaskPayloadManagerTest.java b/processing/src/test/java/org/apache/druid/tasklogs/TaskPayloadManagerTest.java
index 4c53061a86f2..6e61df0989e7 100644
--- a/processing/src/test/java/org/apache/druid/tasklogs/TaskPayloadManagerTest.java
+++ b/processing/src/test/java/org/apache/druid/tasklogs/TaskPayloadManagerTest.java
@@ -19,7 +19,7 @@
package org.apache.druid.tasklogs;
-import org.apache.commons.lang.NotImplementedException;
+import org.apache.commons.lang3.NotImplementedException;
import org.junit.Assert;
import org.junit.Test;
diff --git a/rewrite.yml b/rewrite.yml
index ac715f51e8cc..dd375719a948 100644
--- a/rewrite.yml
+++ b/rewrite.yml
@@ -20,6 +20,7 @@ recipeList:
- org.openrewrite.java.testing.junit5.RemoveObsoleteRunners:
obsoleteRunners:
- org.junit.experimental.runners.Enclosed
+ - org.openrewrite.apache.commons.lang.UpgradeApacheCommonsLang_2_3
---
type: specs.openrewrite.org/v1beta/recipe
name: org.apache.druid.UpgradeCalciteTestsToJunit5
diff --git a/server/pom.xml b/server/pom.xml
index 6cfeee55f57c..3300606d1067 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -308,10 +308,6 @@
com.google.errorprone
error_prone_annotations
-
- commons-lang
- commons-lang
-
org.slf4j
slf4j-api
diff --git a/server/src/main/java/org/apache/druid/client/cache/ForegroundCachePopulator.java b/server/src/main/java/org/apache/druid/client/cache/ForegroundCachePopulator.java
index 8c3643a45fd4..60761ce78be8 100644
--- a/server/src/main/java/org/apache/druid/client/cache/ForegroundCachePopulator.java
+++ b/server/src/main/java/org/apache/druid/client/cache/ForegroundCachePopulator.java
@@ -23,7 +23,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.google.common.base.Preconditions;
-import org.apache.commons.lang.mutable.MutableBoolean;
+import org.apache.commons.lang3.mutable.MutableBoolean;
import org.apache.druid.java.util.common.guava.Sequence;
import org.apache.druid.java.util.common.guava.SequenceWrapper;
import org.apache.druid.java.util.common.guava.Sequences;
diff --git a/server/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorStateManager.java b/server/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorStateManager.java
index 88049f18b087..f30517d1b225 100644
--- a/server/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorStateManager.java
+++ b/server/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorStateManager.java
@@ -21,7 +21,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Preconditions;
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.druid.indexer.TaskState;
import org.apache.druid.java.util.common.DateTimes;
import org.joda.time.DateTime;
diff --git a/server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java b/server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java
index ecfad572e745..96cfd5dbf042 100644
--- a/server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java
+++ b/server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java
@@ -31,7 +31,6 @@
import com.google.common.hash.Hashing;
import com.google.common.io.BaseEncoding;
import com.google.inject.Inject;
-import org.apache.commons.lang.StringEscapeUtils;
import org.apache.druid.error.InvalidInput;
import org.apache.druid.indexing.overlord.DataSourceMetadata;
import org.apache.druid.indexing.overlord.IndexerMetadataStorageCoordinator;
@@ -2533,7 +2532,7 @@ private Set segmentExistsBatch(final Handle handle, final Set> segmentsLists = Lists.partition(new ArrayList<>(segments), MAX_NUM_SEGMENTS_TO_ANNOUNCE_AT_ONCE);
for (List segmentList : segmentsLists) {
String segmentIds = segmentList.stream()
- .map(segment -> "'" + StringEscapeUtils.escapeSql(segment.getId().toString()) + "'")
+ .map(segment -> "'" + StringUtils.escapeSql(segment.getId().toString()) + "'")
.collect(Collectors.joining(","));
List existIds = handle.createQuery(StringUtils.format("SELECT id FROM %s WHERE id in (%s)", dbTables.getSegmentsTable(), segmentIds))
.mapTo(String.class)
diff --git a/server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java b/server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java
index e383e6ad87c8..3f4e1da069ae 100644
--- a/server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java
+++ b/server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java
@@ -1031,7 +1031,7 @@ public Void withHandle(Handle handle) throws Exception
ResultSet resultSet = getIndexInfo(databaseMetaData, tableName);
while (resultSet.next()) {
String indexName = resultSet.getString("INDEX_NAME");
- if (org.apache.commons.lang.StringUtils.isNotBlank(indexName)) {
+ if (org.apache.commons.lang3.StringUtils.isNotBlank(indexName)) {
res.add(StringUtils.toUpperCase(indexName));
}
}
diff --git a/server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java b/server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java
index 23e6ec48b8f4..e840a5f89eeb 100644
--- a/server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java
+++ b/server/src/main/java/org/apache/druid/query/lookup/LookupReferencesManager.java
@@ -28,7 +28,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.inject.Inject;
-import org.apache.commons.lang.mutable.MutableBoolean;
+import org.apache.commons.lang3.mutable.MutableBoolean;
import org.apache.druid.client.coordinator.Coordinator;
import org.apache.druid.concurrent.LifecycleLock;
import org.apache.druid.discovery.DruidLeaderClient;
diff --git a/server/src/main/java/org/apache/druid/segment/metadata/SegmentSchemaManager.java b/server/src/main/java/org/apache/druid/segment/metadata/SegmentSchemaManager.java
index 071fa49c67b4..a720872f84ed 100644
--- a/server/src/main/java/org/apache/druid/segment/metadata/SegmentSchemaManager.java
+++ b/server/src/main/java/org/apache/druid/segment/metadata/SegmentSchemaManager.java
@@ -26,7 +26,6 @@
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.inject.Inject;
-import org.apache.commons.lang.StringEscapeUtils;
import org.apache.druid.guice.LazySingleton;
import org.apache.druid.java.util.common.DateTimes;
import org.apache.druid.java.util.common.ISE;
@@ -362,7 +361,7 @@ private Map> fingerprintExistBatch(
Map> existingFingerprints = new HashMap<>();
for (List fingerprintList : partitionedFingerprints) {
String fingerprints = fingerprintList.stream()
- .map(fingerprint -> "'" + StringEscapeUtils.escapeSql(fingerprint) + "'")
+ .map(fingerprint -> "'" + StringUtils.escapeSql(fingerprint) + "'")
.collect(Collectors.joining(","));
handle.createQuery(
StringUtils.format(
@@ -380,7 +379,7 @@ private Map> fingerprintExistBatch(
private String getInClause(final Stream ids)
{
return ids
- .map(value -> "'" + StringEscapeUtils.escapeSql(value) + "'")
+ .map(value -> "'" + StringUtils.escapeSql(value) + "'")
.collect(Collectors.joining(","));
}
diff --git a/server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java b/server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java
index 0d7d01253c84..ec63b589a791 100644
--- a/server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java
+++ b/server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java
@@ -36,7 +36,7 @@
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
-import org.apache.commons.lang.mutable.MutableLong;
+import org.apache.commons.lang3.mutable.MutableLong;
import org.apache.druid.client.cache.Cache;
import org.apache.druid.data.input.Committer;
import org.apache.druid.data.input.InputRow;
diff --git a/server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java b/server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java
index 37ae14f56c30..f4b11f4c8a07 100644
--- a/server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java
+++ b/server/src/main/java/org/apache/druid/server/ClientQuerySegmentWalker.java
@@ -23,7 +23,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Iterables;
import com.google.inject.Inject;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.client.CachingClusteredClient;
import org.apache.druid.client.DirectDruidClient;
import org.apache.druid.client.cache.Cache;
diff --git a/server/src/main/java/org/apache/druid/server/compaction/CompactionStatus.java b/server/src/main/java/org/apache/druid/server/compaction/CompactionStatus.java
index ffbdd44bce6a..2bc6d251f06b 100644
--- a/server/src/main/java/org/apache/druid/server/compaction/CompactionStatus.java
+++ b/server/src/main/java/org/apache/druid/server/compaction/CompactionStatus.java
@@ -20,7 +20,7 @@
package org.apache.druid.server.compaction;
import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang3.ArrayUtils;
import org.apache.druid.client.indexing.ClientCompactionTaskGranularitySpec;
import org.apache.druid.client.indexing.ClientCompactionTaskQueryTuningConfig;
import org.apache.druid.client.indexing.ClientCompactionTaskTransformSpec;
diff --git a/server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java b/server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java
index 1614cb690747..21bf0baa5bde 100644
--- a/server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java
+++ b/server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java
@@ -29,7 +29,7 @@
import com.google.inject.Inject;
import com.sun.jersey.spi.container.ResourceFilters;
import it.unimi.dsi.fastutil.objects.Object2LongMap;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.audit.AuditEntry;
import org.apache.druid.audit.AuditManager;
import org.apache.druid.client.CoordinatorServerView;
diff --git a/server/src/main/java/org/apache/druid/server/initialization/jetty/StandardResponseHeaderFilterHolder.java b/server/src/main/java/org/apache/druid/server/initialization/jetty/StandardResponseHeaderFilterHolder.java
index 2960135f2087..2f12ff2402c8 100644
--- a/server/src/main/java/org/apache/druid/server/initialization/jetty/StandardResponseHeaderFilterHolder.java
+++ b/server/src/main/java/org/apache/druid/server/initialization/jetty/StandardResponseHeaderFilterHolder.java
@@ -21,7 +21,7 @@
import com.google.common.collect.ImmutableSet;
import com.google.inject.Inject;
-import org.apache.commons.lang.CharUtils;
+import org.apache.commons.lang3.CharUtils;
import org.apache.druid.java.util.common.IAE;
import org.apache.druid.server.initialization.ServerConfig;
import org.eclipse.jetty.client.api.Response;
diff --git a/services/pom.xml b/services/pom.xml
index 83c109b5abaf..f6137db90849 100644
--- a/services/pom.xml
+++ b/services/pom.xml
@@ -138,8 +138,8 @@
error_prone_annotations
- commons-lang
- commons-lang
+ org.apache.commons
+ commons-lang3
javax.ws.rs
diff --git a/services/src/main/java/org/apache/druid/server/router/ManualTieredBrokerSelectorStrategy.java b/services/src/main/java/org/apache/druid/server/router/ManualTieredBrokerSelectorStrategy.java
index 5569946d0af2..f0c3a89887c4 100644
--- a/services/src/main/java/org/apache/druid/server/router/ManualTieredBrokerSelectorStrategy.java
+++ b/services/src/main/java/org/apache/druid/server/router/ManualTieredBrokerSelectorStrategy.java
@@ -23,7 +23,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Optional;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.druid.java.util.common.logger.Logger;
import org.apache.druid.query.Query;
import org.apache.druid.query.QueryContext;