update 优化 项目中的一些存在null的问题 与一些性能问题 小优化

This commit is contained in:
疯狂的狮子Li
2026-04-01 10:13:18 +08:00
parent 65c4a7a964
commit aca29a329a
19 changed files with 204 additions and 129 deletions

View File

@@ -23,6 +23,8 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
public static final String SLASH = "/";
private static final AntPathMatcher ANT_PATH_MATCHER = new AntPathMatcher();
@Deprecated
private StringUtils() {
}
@@ -233,8 +235,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
* @param url 需要匹配的url
*/
public static boolean isMatch(String pattern, String url) {
AntPathMatcher matcher = new AntPathMatcher();
return matcher.match(pattern, url);
return ANT_PATH_MATCHER.match(pattern, url);
}
/**
@@ -547,4 +548,12 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
return Strings.CS.containsAny(cs, searchCharSequences);
}
/**
* 将一个字符串替换为较大字符串内的另一个字符串,一次
*/
public static String replaceOnce(final String text, final String searchString, final String replacement) {
return Strings.CS.replaceOnce(text, searchString, replacement);
}
}

View File

@@ -15,7 +15,7 @@ public class SqlUtil {
/**
* 定义常用的 sql关键字
*/
public static String SQL_REGEX = "\u000B|and |extractvalue|updatexml|sleep|exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |or |union |like |+|/*|user()";
public static final String SQL_REGEX = "\u000B|%0A|and |extractvalue|updatexml|sleep|information_schema|exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |or |union |like |+|/*|user()";
/**
* 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序)