Skip to content

Commit 712ef08

Browse files
committed
[SPARK-53091][SQL] Ban org.apache.commons.lang3.Strings
### What changes were proposed in this pull request? This PR aims to ban `org.apache.commons.lang3.Strings` in Java code. Since we already replaces all usage in Scala code, this is the only instance to remove. https://github.com/apache/spark/blob/a8e98340be5189d4be7f3dfe1863faddc3e574bc/scalastyle-config.xml#L393 ### Why are the changes needed? To use built-in simple Java String APIs consistently. ### 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 #51805 from dongjoon-hyun/SPARK-53091. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 1de64a4 commit 712ef08

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dev/checkstyle.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@
185185
<property name="illegalPkgs" value="org.apache.commons.lang" />
186186
<property name="illegalPkgs" value="org.apache.commons.lang3.tuple" />
187187
<property name="illegalClasses" value="org.apache.commons.lang3.JavaVersion" />
188+
<property name="illegalClasses" value="org.apache.commons.lang3.Strings" />
188189
<property name="illegalClasses" value="org.apache.hadoop.io.IOUtils" />
189190
<property name="illegalClasses" value="com.google.common.base.Strings" />
190191
</module>

sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/LdapAuthenticationProviderImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import javax.naming.directory.InitialDirContext;
2727
import javax.security.sasl.AuthenticationException;
2828

29-
import org.apache.commons.lang3.Strings;
3029
import org.apache.hadoop.hive.conf.HiveConf;
3130
import org.apache.hive.service.ServiceUtils;
3231

@@ -72,7 +71,7 @@ public void Authenticate(String user, String password) throws AuthenticationExce
7271
} else {
7372
String[] patterns = userDNPattern.split(":");
7473
for (String pattern : patterns) {
75-
if (Strings.CS.contains(pattern, ",") && Strings.CS.contains(pattern, "=")) {
74+
if (pattern.contains(",") && pattern.contains("=")) {
7675
candidatePrincipals.add(pattern.replaceAll("%s", user));
7776
}
7877
}

0 commit comments

Comments
 (0)