Skip to content

Commit

Permalink
[FLINK-29624][Common][Connector][Filesystem] Upgrade org.apache.commo…
Browse files Browse the repository at this point in the history
…ns:commons-lang3 from 3.3.2 to 3.12.0

* Remove Pulsar specific version of `commons-lang3` since Flink now uses a newer version
* Replace usage of deprecated method `org.apache.commons.lang3.ArrayUtils#add` with `org.apache.commons.lang3.ArrayUtils#insert`
* Replace usage of `org.apache.commons.lang3.StringEscapeUtils` with `org.apache.commons.text.StringEscapeUtils`
  • Loading branch information
MartijnVisser committed Nov 1, 2022
1 parent 300724e commit 68d93ab
Show file tree
Hide file tree
Showing 19 changed files with 44 additions and 35 deletions.
10 changes: 0 additions & 10 deletions flink-connectors/flink-connector-pulsar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ under the License.
<!-- Test Libraries -->
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
<os-maven-plugin.version>1.7.0</os-maven-plugin.version>
<pulsar-commons-lang3.version>3.11</pulsar-commons-lang3.version>
<pulsar-netty.version>4.1.77.Final</pulsar-netty.version>
<pulsar-grpc.version>1.45.1</pulsar-grpc.version>
</properties>
Expand Down Expand Up @@ -136,15 +135,6 @@ under the License.
<scope>test</scope>
</dependency>

<!-- Pulsar use a newer commons-lang3 in broker. -->
<!-- Bump the version only for testing. -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${pulsar-commons-lang3.version}</version>
<scope>test</scope>
</dependency>

<!-- Add Pulsar 2.x as a dependency. -->
<!-- Move this to button for avoiding class conflicts with pulsar-broker. -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This project bundles the following dependencies under the Apache Software Licens
- io.netty:netty-all:4.1.70.Final
- io.dropwizard.metrics:metrics-core:3.2.6
- org.apache.commons:commons-crypto:1.0.0
- org.apache.commons:commons-lang3:3.3.2
- org.apache.commons:commons-lang3:3.12.0
- org.apache.hbase:hbase-client:2.2.3
- org.apache.hbase:hbase-common:2.2.3
- org.apache.hbase:hbase-protocol:2.2.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ The Apache Software Foundation (https://www.apache.org/).

This project bundles the following dependencies under the Apache Software License 2.0. (https://www.apache.org/licenses/LICENSE-2.0.txt)

- org.apache.avro:avro:1.8.2
- org.apache.avro:avro-mapred:hadoop2:1.8.2
- org.apache.avro:avro:1.8.2
- org.apache.hive:hive-exec:3.1.3

This project bundles the following dependencies under the BSD license.
Expand All @@ -26,18 +26,18 @@ the Apache Software License 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
- javax.jdo:jdo-api:3.0.1
- joda-time:joda-time:2.9.9
- net.sf.opencsv:opencsv:2.3
- org.apache.commons:commons-lang3:3.9
- org.apache.commons:commons-lang3:3.12.0
- org.apache.hive.shims:hive-shims-0.23:3.1.3
- org.apache.hive.shims:hive-shims-common:3.1.3
- org.apache.hive:hive-common:3.1.3
- org.apache.hive:hive-llap-client:3.1.3
- org.apache.hive:hive-llap-common:3.1.3
- org.apache.hive:hive-metastore:3.1.3
- org.apache.hive:hive-serde:3.1.3
- org.apache.hive:hive-service-rpc:3.1.3
- org.apache.hive:hive-spark-client:3.1.3
- org.apache.hive:hive-standalone-metastore:3.1.3
- org.apache.hive:hive-storage-api:2.7.0
- org.apache.hive:hive-spark-client:3.1.3
- org.apache.hive.shims:hive-shims-0.23:3.1.3
- org.apache.hive.shims:hive-shims-common:3.1.3
- org.apache.orc:orc-core:1.5.8
- org.apache.orc:orc-shims:1.5.8
- org.apache.orc:orc-tools:1.5.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ This project bundles the following dependencies under the Apache Software Licens
- commons-lang:commons-lang:2.6
- commons-logging:commons-logging:1.1.3
- commons-codec:commons-codec:1.15
- org.apache.commons:commons-lang3:3.3.2
- org.apache.commons:commons-lang3:3.12.0
- com.google.guava:guava:29.0-jre
- com.google.guava:failureaccess:1.0.1
7 changes: 7 additions & 0 deletions flink-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ under the License.
<!-- managed version -->
</dependency>

<!-- standard utilities -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<!-- managed version -->
</dependency>

<!-- for the fallback generic serializer -->
<dependency>
<groupId>com.esotericsoftware.kryo</groupId>
Expand Down
3 changes: 2 additions & 1 deletion flink-dist/src/main/resources/META-INF/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ This project bundles the following dependencies under the Apache Software Licens
- commons-collections:commons-collections:3.2.2
- commons-io:commons-io:2.11.0
- org.apache.commons:commons-compress:1.21
- org.apache.commons:commons-lang3:3.3.2
- org.apache.commons:commons-lang3:3.12.0
- org.apache.commons:commons-math3:3.6.1
- org.apache.commons:commons-text:1.10.0
- org.javassist:javassist:3.24.0-GA
- org.lz4:lz4-java:1.8.0
- org.objenesis:objenesis:2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ This project bundles the following dependencies under the Apache Software Licens
- commons-logging:commons-logging:1.1.3
- org.apache.commons:commons-compress:1.21
- org.apache.commons:commons-configuration2:2.1.1
- org.apache.commons:commons-lang3:3.3.2
- org.apache.commons:commons-text:1.4
- org.apache.commons:commons-lang3:3.12.0
- org.apache.commons:commons-text:1.10.0
- org.apache.hadoop.thirdparty:hadoop-shaded-guava:1.1.1
- org.apache.hadoop.thirdparty:hadoop-shaded-protobuf_3_7:1.1.1
- org.apache.hadoop:hadoop-annotations:3.3.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ This project bundles the following dependencies under the Apache Software Licens
- joda-time:joda-time:2.5
- org.apache.commons:commons-compress:1.21
- org.apache.commons:commons-configuration2:2.1.1
- org.apache.commons:commons-lang3:3.3.2
- org.apache.commons:commons-text:1.4
- org.apache.commons:commons-lang3:3.12.0
- org.apache.commons:commons-text:1.10.0
- org.apache.hadoop.thirdparty:hadoop-shaded-guava:1.1.1
- org.apache.hadoop.thirdparty:hadoop-shaded-protobuf_3_7:1.1.1
- org.apache.hadoop:hadoop-annotations:3.3.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ This project bundles the following dependencies under the Apache Software Licens
- org.alluxio:alluxio-shaded-client:2.7.3
- org.apache.commons:commons-compress:1.21
- org.apache.commons:commons-configuration2:2.1.1
- org.apache.commons:commons-lang3:3.3.2
- org.apache.commons:commons-text:1.4
- org.apache.commons:commons-lang3:3.12.0
- org.apache.commons:commons-text:1.10.0
- org.apache.hadoop.thirdparty:hadoop-shaded-guava:1.1.1
- org.apache.hadoop.thirdparty:hadoop-shaded-protobuf_3_7:1.1.1
- org.apache.hadoop:hadoop-annotations:3.3.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.flink.configuration.ReadableConfig;
import org.apache.flink.table.api.ValidationException;

import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.util.HashSet;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.dataformat.csv.CsvMapper;
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.dataformat.csv.CsvSchema;

import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.util.Collections;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import org.apache.flink.table.types.DataType;
import org.apache.flink.table.types.logical.RowType;

import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.util.Collections;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.apache.flink.runtime.operators.shipping.ShipStrategyType;
import org.apache.flink.util.StringUtils;

import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.io.File;
import java.io.FileOutputStream;
Expand Down
5 changes: 5 additions & 0 deletions flink-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ under the License.
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
</dependency>

<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonFactory;
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonGenerator;

import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.io.StringWriter;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.apache.calcite.sql.type.SqlTypeName;
import org.apache.calcite.sql.util.SqlShuttle;
import org.apache.calcite.util.NlsString;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.text.StringEscapeUtils;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ public static Object[][] parameters() {
.map(
params ->
new Object[][] {
ArrayUtils.add(params, 0),
ArrayUtils.add(params, BUFFER_PER_CHANNEL)
ArrayUtils.insert(params.length, params, 0),
ArrayUtils.insert(params.length, params, BUFFER_PER_CHANNEL)
})
.flatMap(Arrays::stream)
.toArray(Object[][]::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ public static Object[][] getScaleFactors() {
.map(
params ->
new Object[][] {
ArrayUtils.add(params, 0),
ArrayUtils.add(params, BUFFER_PER_CHANNEL)
ArrayUtils.insert(params.length, params, 0),
ArrayUtils.insert(params.length, params, BUFFER_PER_CHANNEL)
})
.flatMap(Arrays::stream)
.toArray(Object[][]::new);
Expand Down
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,13 @@ under the License.
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
<version>3.12.0</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
</dependency>

<dependency>
Expand Down

0 comments on commit 68d93ab

Please sign in to comment.