Replace "google.common.collect.Strings" API with jdk API (#6464)

This commit is contained in:
ZZQ的 2021-07-27 13:53:52 +08:00 committed by GitHub
parent 47c6706a63
commit 838a62cc4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,6 @@
package com.alibaba.nacos.common.utils; package com.alibaba.nacos.common.utils;
import com.google.common.base.Strings;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import java.util.HashSet; import java.util.HashSet;
@ -194,7 +193,7 @@ public final class ConvertUtils {
*/ */
@SuppressWarnings("all") @SuppressWarnings("all")
public static Boolean toBooleanObject(String str) { public static Boolean toBooleanObject(String str) {
String formatStr = Strings.nullToEmpty(str).toLowerCase(); String formatStr = (str == null ? StringUtils.EMPTY : str).toLowerCase();
if (TRUE_SET.contains(formatStr)) { if (TRUE_SET.contains(formatStr)) {
return true; return true;