mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
匿名类替换为lambda表达式
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
package cn.hutool.dfa;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 敏感词工具类
|
||||
* @author Looly
|
||||
@@ -33,13 +32,9 @@ public final class SensitiveUtil {
|
||||
*/
|
||||
public static void init(final Collection<String> sensitiveWords, boolean isAsync){
|
||||
if(isAsync){
|
||||
ThreadUtil.execAsync(new Callable<Boolean>(){
|
||||
@Override
|
||||
public Boolean call() throws Exception {
|
||||
init(sensitiveWords);
|
||||
return true;
|
||||
}
|
||||
|
||||
ThreadUtil.execAsync(() -> {
|
||||
init(sensitiveWords);
|
||||
return true;
|
||||
});
|
||||
}else{
|
||||
init(sensitiveWords);
|
||||
|
Reference in New Issue
Block a user