This is an automated email from the ASF dual-hosted git repository. dongjoon pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new 50882d2d8886 [SPARK-53115][TESTS] Ban `org.apache.commons.lang3.StringUtils` 50882d2d8886 is described below commit 50882d2d88866ef0747ab7b542ac8ebaab4418ae Author: Dongjoon Hyun <dongj...@apache.org> AuthorDate: Mon Aug 4 16:13:23 2025 -0700 [SPARK-53115][TESTS] Ban `org.apache.commons.lang3.StringUtils` ### What changes were proposed in this pull request? This PR aims to ban `org.apache.commons.lang3.StringUtils` usage in favor of Java's `String` or Spark's `JavaUtils/SparkStringUtils/Utils` methods. ### Why are the changes needed? Apache Spark already migrated to `Java` or `Spark`'s built-in methods like the following examples: - #51814 - #51815 From now, we had better recommend to use Java's or Spark's methods consistently if there is no reason to use 3rd party library. ### Does this PR introduce _any_ user-facing change? No behavior change. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #51833 from dongjoon-hyun/SPARK-53115. Authored-by: Dongjoon Hyun <dongj...@apache.org> Signed-off-by: Dongjoon Hyun <dongj...@apache.org> --- dev/checkstyle.xml | 1 + scalastyle-config.xml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/dev/checkstyle.xml b/dev/checkstyle.xml index 91c7af63a9b6..e1ca3e87a233 100644 --- a/dev/checkstyle.xml +++ b/dev/checkstyle.xml @@ -186,6 +186,7 @@ <property name="illegalPkgs" value="org.apache.commons.lang3.tuple" /> <property name="illegalClasses" value="org.apache.commons.lang3.JavaVersion" /> <property name="illegalClasses" value="org.apache.commons.lang3.Strings" /> + <property name="illegalClasses" value="org.apache.commons.lang3.StringUtils" /> <property name="illegalClasses" value="org.apache.commons.lang3.SystemUtils" /> <property name="illegalClasses" value="org.apache.hadoop.io.IOUtils" /> <property name="illegalClasses" value="com.google.common.base.Strings" /> diff --git a/scalastyle-config.xml b/scalastyle-config.xml index 5d59e7d5e83c..6f2378c36ec7 100644 --- a/scalastyle-config.xml +++ b/scalastyle-config.xml @@ -404,6 +404,11 @@ This file is divided into 3 sections: <customMessage>Use Utils.strip method instead</customMessage> </check> + <check customId="commonslang3stringutils" level="error" class="org.scalastyle.file.RegexChecker" enabled="true"> + <parameters><parameter name="regex">org\.apache\.commons\.lang3\.StringUtils\b</parameter></parameters> + <customMessage>Use Java String or Spark's Utils/JavaUtils methods instead</customMessage> + </check> + <check customId="commonslang3systemutils" level="error" class="org.scalastyle.file.RegexChecker" enabled="true"> <parameters><parameter name="regex">org\.apache\.commons\.lang3\.SystemUtils\b</parameter></parameters> <customMessage>Use SparkSystemUtils or Utils instead</customMessage> --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org