mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -16,12 +16,10 @@ public class SimpleTaskListener implements TaskListener{
|
||||
|
||||
@Override
|
||||
public void onSucceeded(TaskExecutor executor) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(TaskExecutor executor, Throwable exception) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
*/
|
||||
public class BoolArrayValueMatcher implements ValueMatcher{
|
||||
|
||||
boolean[] bValues;
|
||||
private final boolean[] bValues;
|
||||
|
||||
public BoolArrayValueMatcher(List<Integer> intValueList) {
|
||||
bValues = new boolean[Collections.max(intValueList) + 1];
|
||||
|
@@ -18,8 +18,7 @@ import cn.hutool.cron.CronException;
|
||||
*
|
||||
*/
|
||||
public class InvokeTask implements Task{
|
||||
|
||||
private Class<?> clazz;
|
||||
|
||||
private Object obj;
|
||||
private Method method;
|
||||
|
||||
@@ -41,18 +40,18 @@ public class InvokeTask implements Task{
|
||||
if(StrUtil.isBlank(className)) {
|
||||
throw new IllegalArgumentException("Class name is blank !");
|
||||
}
|
||||
this.clazz = ClassLoaderUtil.loadClass(className);
|
||||
if(null == this.clazz) {
|
||||
final Class<?> clazz = ClassLoaderUtil.loadClass(className);
|
||||
if(null == clazz) {
|
||||
throw new IllegalArgumentException("Load class with name of [" + className + "] fail !");
|
||||
}
|
||||
this.obj = ReflectUtil.newInstanceIfPossible(this.clazz);
|
||||
this.obj = ReflectUtil.newInstanceIfPossible(clazz);
|
||||
|
||||
//方法
|
||||
final String methodName = classNameWithMethodName.substring(splitIndex + 1);
|
||||
if(StrUtil.isBlank(methodName)) {
|
||||
throw new IllegalArgumentException("Method name is blank !");
|
||||
}
|
||||
this.method = ClassUtil.getPublicMethod(this.clazz, methodName);
|
||||
this.method = ClassUtil.getPublicMethod(clazz, methodName);
|
||||
if(null == this.method) {
|
||||
throw new IllegalArgumentException("No method with name of [" + methodName + "] !");
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@ public class TestJob {
|
||||
/**
|
||||
* 执行循环定时任务,测试在定时任务结束时作为deamon线程是否能正常结束
|
||||
*/
|
||||
@SuppressWarnings("InfiniteLoopStatement")
|
||||
public void doWhileTest() {
|
||||
String name = Thread.currentThread().getName();
|
||||
while (true) {
|
||||
|
Reference in New Issue
Block a user