1.删除Operator临时变量

2.删除不引用的LOG
This commit is contained in:
mll
2022-09-07 15:38:54 +08:00
parent e8b27c4a22
commit 5427553cb2
5 changed files with 12 additions and 18 deletions

View File

@@ -19,15 +19,13 @@ public class AnyOperator extends BaseOperator {
WhenCondition whenCondition = OperatorHelper.convert(objects[0], WhenCondition.class);
boolean any = false;
if (objects[1] instanceof Boolean) {
any = Boolean.parseBoolean(objects[1].toString().toLowerCase());
// any
whenCondition.setAny(Boolean.parseBoolean(objects[1].toString().toLowerCase()));
} else {
throw new QLException("the parameter must be boolean type");
}
whenCondition.setAny(any);
return whenCondition;
}
}

View File

@@ -23,16 +23,14 @@ public class IdOperator extends BaseOperator {
Condition condition = OperatorHelper.convert(objects[0], Condition.class);
String id;
if (objects[1] instanceof String) {
id = objects[1].toString();
// id
condition.setId(objects[1].toString());
} else {
LOG.error("the parameter must be String type!");
throw new QLException("the parameter must be String type");
}
condition.setId(id);
return condition;
}
}

View File

@@ -19,15 +19,13 @@ public class IgnoreErrorOperator extends BaseOperator {
WhenCondition condition = OperatorHelper.convert(objects[0], WhenCondition.class);
boolean ignoreError = false;
if (objects[1] instanceof Boolean) {
ignoreError = Boolean.parseBoolean(objects[1].toString().toLowerCase());
// ignoreError
condition.setErrorResume(Boolean.parseBoolean(objects[1].toString().toLowerCase()));
} else {
throw new QLException("The parameter must be boolean type");
}
condition.setErrorResume(ignoreError);
return condition;
}
}

View File

@@ -20,7 +20,7 @@ public class TagOperator extends BaseOperator {
Node node = OperatorHelper.convert(objects[0], Node.class);
String tag = null;
String tag ;
if (objects[1] instanceof String) {
tag = objects[1].toString();
} else {
@@ -30,7 +30,9 @@ public class TagOperator extends BaseOperator {
//这里为什么要clone一个呢
//因为tag是跟着chain走的。而在el上下文里的放的都是同一个node如果多个同样的node tag不同则这里必须copy
Node copyNode = FlowBus.copyNode(node.getId());
if (null == copyNode){
throw new QLException("The Node must be not null");
}
copyNode.setTag(tag);
return copyNode;

View File

@@ -19,15 +19,13 @@ public class ThreadPoolOperator extends BaseOperator {
WhenCondition whenCondition = OperatorHelper.convert(objects[0], WhenCondition.class);
String threadPoolClazz = null;
if (objects[1] instanceof String) {
threadPoolClazz = objects[1].toString();
// threadPoolClazz
whenCondition.setThreadExecutorClass(objects[1].toString());
} else {
throw new QLException("the parameter must be String type");
}
whenCondition.setThreadExecutorClass(threadPoolClazz);
return whenCondition;
}
}