From 40253dd06ff04bf03f092c44cb0413a80dcf88c6 Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Mon, 15 Jan 2024 14:56:28 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=89=E4=BA=9BBeanDef?= =?UTF-8?q?inition=E5=AE=9A=E4=B9=89=E4=B8=AD=E5=B9=B6=E6=B2=A1=E6=9C=89ro?= =?UTF-8?q?ot=20class=EF=BC=8C=E5=AF=BC=E8=87=B4=E4=BA=86NPE=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yomahub/liteflow/spring/DeclBeanDefinition.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/liteflow-spring/src/main/java/com/yomahub/liteflow/spring/DeclBeanDefinition.java b/liteflow-spring/src/main/java/com/yomahub/liteflow/spring/DeclBeanDefinition.java index 017211abf..2a30ebb2a 100644 --- a/liteflow-spring/src/main/java/com/yomahub/liteflow/spring/DeclBeanDefinition.java +++ b/liteflow-spring/src/main/java/com/yomahub/liteflow/spring/DeclBeanDefinition.java @@ -30,7 +30,11 @@ public class DeclBeanDefinition implements BeanDefinitionRegistryPostProcessor { beanDefinitionHolderMap.entrySet().stream().filter(entry -> { Class rawClass = entry.getValue().getResolvableType().getRawClass(); - return Arrays.stream(rawClass.getMethods()).anyMatch(method -> AnnotationUtil.getAnnotation(method, LiteflowMethod.class) != null); + if (rawClass == null){ + return false; + }else{ + return Arrays.stream(rawClass.getMethods()).anyMatch(method -> AnnotationUtil.getAnnotation(method, LiteflowMethod.class) != null); + } }).forEach(entry -> { Class rawClass = entry.getValue().getResolvableType().getRawClass(); List declWarpBeanList = DeclComponentParserHolder.loadDeclComponentParser().parseDeclBean(rawClass); From e33fd3b0f769967b9542dcfd233b1650dd8940b2 Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Mon, 15 Jan 2024 15:11:50 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=88=902.11.4.1?= =?UTF-8?q?=EF=BC=8C=E8=A1=A5=E4=B8=81=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 789f9544e..eda93cec2 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ - 2.11.4 + 2.11.4.1 UTF-8 UTF-8 8 From e60a60e12fc1b0a9cc0d5e4eae4a890b37488ea9 Mon Sep 17 00:00:00 2001 From: guorunze Date: Mon, 15 Jan 2024 16:20:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?STYLE=20#I8VSD6=20=E8=B0=83=E6=95=B4=20chec?= =?UTF-8?q?kObjectSizeGteTwo=20=E5=90=8D=E7=A7=B0=E3=80=81=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E3=80=81=E5=88=A4=E6=96=AD=20=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E8=AF=AF=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yomahub/liteflow/builder/el/operator/AndOperator.java | 2 +- .../liteflow/builder/el/operator/MustOperator.java | 2 +- .../yomahub/liteflow/builder/el/operator/OrOperator.java | 2 +- .../yomahub/liteflow/builder/el/operator/ToOperator.java | 2 +- .../liteflow/builder/el/operator/base/OperatorHelper.java | 8 +++----- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/AndOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/AndOperator.java index 0e5f731ab..29d663cbe 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/AndOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/AndOperator.java @@ -16,7 +16,7 @@ import com.yomahub.liteflow.flow.element.condition.BooleanConditionTypeEnum; public class AndOperator extends BaseOperator { @Override public AndOrCondition build(Object[] objects) throws Exception { - OperatorHelper.checkObjectSizeGtTwo(objects); + OperatorHelper.checkObjectSizeGteTwo(objects); AndOrCondition andOrCondition = new AndOrCondition(); andOrCondition.setBooleanConditionType(BooleanConditionTypeEnum.AND); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/MustOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/MustOperator.java index b3e3f0c28..8a903008c 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/MustOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/MustOperator.java @@ -19,7 +19,7 @@ public class MustOperator extends BaseOperator { @Override public WhenCondition build(Object[] objects) throws Exception { - OperatorHelper.checkObjectSizeGtTwo(objects); + OperatorHelper.checkObjectSizeGteTwo(objects); String errorMsg = "The caller must be WhenCondition item"; WhenCondition whenCondition = OperatorHelper.convert(objects[0], WhenCondition.class, errorMsg); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/OrOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/OrOperator.java index d084a7536..361ab62bb 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/OrOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/OrOperator.java @@ -16,7 +16,7 @@ import com.yomahub.liteflow.flow.element.condition.BooleanConditionTypeEnum; public class OrOperator extends BaseOperator { @Override public AndOrCondition build(Object[] objects) throws Exception { - OperatorHelper.checkObjectSizeGtTwo(objects); + OperatorHelper.checkObjectSizeGteTwo(objects); AndOrCondition andOrCondition = new AndOrCondition(); andOrCondition.setBooleanConditionType(BooleanConditionTypeEnum.OR); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ToOperator.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ToOperator.java index d38722a03..4eede8779 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ToOperator.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/ToOperator.java @@ -15,7 +15,7 @@ public class ToOperator extends BaseOperator { @Override public SwitchCondition build(Object[] objects) throws Exception { - OperatorHelper.checkObjectSizeGtTwo(objects); + OperatorHelper.checkObjectSizeGteTwo(objects); String errorMsg = "The caller must be SwitchCondition item"; SwitchCondition switchCondition = OperatorHelper.convert(objects[0], SwitchCondition.class, errorMsg); diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/base/OperatorHelper.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/base/OperatorHelper.java index c54681a63..07a163412 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/base/OperatorHelper.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/el/operator/base/OperatorHelper.java @@ -10,8 +10,6 @@ import com.yomahub.liteflow.exception.DataNotFoundException; import com.yomahub.liteflow.flow.element.Condition; import com.yomahub.liteflow.flow.element.Executable; import com.yomahub.liteflow.flow.element.Node; -import com.yomahub.liteflow.flow.element.condition.AndOrCondition; -import com.yomahub.liteflow.flow.element.condition.NotCondition; import java.util.Objects; @@ -35,13 +33,13 @@ public class OperatorHelper { } /** - * 检查参数数量,大于 2 + * 检查参数数量,大于等于 2 * @param objects objects * @throws QLException QLException */ - public static void checkObjectSizeGtTwo(Object[] objects) throws QLException { + public static void checkObjectSizeGteTwo(Object[] objects) throws QLException { checkObjectSizeGtZero(objects); - if (objects.length <= 1) { + if (objects.length < 2) { throw new QLException("parameter error"); } }