mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-04-05 17:37:53 +08:00
修复 sa-token-jfinal-plugin 模块代码警告
This commit is contained in:
parent
3b52c09b01
commit
b1d2306b7d
@ -22,14 +22,14 @@ import java.util.regex.Pattern;
|
||||
|
||||
public class PathAnalyzer {
|
||||
|
||||
private static Map<String, PathAnalyzer> cached = new LinkedHashMap<>();
|
||||
private Pattern pattern;
|
||||
private static final Map<String, PathAnalyzer> cached = new LinkedHashMap<>();
|
||||
private final Pattern pattern;
|
||||
|
||||
public static PathAnalyzer get(String expr) {
|
||||
PathAnalyzer pa = (PathAnalyzer)cached.get(expr);
|
||||
PathAnalyzer pa = cached.get(expr);
|
||||
if (pa == null) {
|
||||
synchronized(expr.intern()) {
|
||||
pa = (PathAnalyzer)cached.get(expr);
|
||||
pa = cached.get(expr);
|
||||
if (pa == null) {
|
||||
pa = new PathAnalyzer(expr);
|
||||
cached.put(expr, pa);
|
||||
@ -41,7 +41,7 @@ public class PathAnalyzer {
|
||||
}
|
||||
|
||||
private PathAnalyzer(String expr) {
|
||||
this.pattern = Pattern.compile(exprCompile(expr), 2);
|
||||
this.pattern = Pattern.compile(exprCompile(expr), Pattern.CASE_INSENSITIVE);
|
||||
}
|
||||
|
||||
public Matcher matcher(String uri) {
|
||||
|
@ -132,7 +132,7 @@ public class SaTokenActionHandler extends ActionHandler {
|
||||
/**
|
||||
* 抽取出该方法是为了缩短 handle 方法中的代码量,确保获得 JIT 优化,
|
||||
* 方法长度超过 8000 个字节码时,将不会被 JIT 编译成二进制码
|
||||
*
|
||||
* <p>
|
||||
* 通过开启 java 的 -XX:+PrintCompilation 启动参数得知,handle(...)
|
||||
* 方法(73 行代码)已被 JIT 优化,优化后的字节码长度为 593 个字节,相当于
|
||||
* 每行代码产生 8.123 个字节
|
||||
|
@ -235,7 +235,7 @@ public class SaTokenDaoRedis implements SaTokenDao {
|
||||
@Override
|
||||
public List<String> searchData(String prefix, String keyword, int start, int size, boolean sortType) {
|
||||
Set<String> keys = redis.keys(prefix + "*" + keyword + "*");
|
||||
List<String> list = new ArrayList<String>(keys);
|
||||
List<String> list = new ArrayList<>(keys);
|
||||
return SaFoxUtil.searchList(list, start, size, sortType);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user