From 61db42968d4571a00df02c85a7e8765735162b39 Mon Sep 17 00:00:00 2001 From: bryan31 Date: Sun, 29 May 2022 18:04:02 +0800 Subject: [PATCH] =?UTF-8?q?enhancement=20#I5851R=20=E5=AF=B9=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E7=BB=84=E4=BB=B6=E5=90=8D=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?trim=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=BC=80=E5=8F=91=E8=80=85?= =?UTF-8?q?=E6=89=8B=E8=AF=AF=E6=9C=89=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../liteflow/builder/LiteFlowNodeBuilder.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowNodeBuilder.java b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowNodeBuilder.java index e5c5ca8f1..f4fc745ae 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowNodeBuilder.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/builder/LiteFlowNodeBuilder.java @@ -49,17 +49,26 @@ public class LiteFlowNodeBuilder { } public LiteFlowNodeBuilder setId(String nodeId) { - this.node.setId(nodeId); + if (StrUtil.isBlank(nodeId)){ + return this; + } + this.node.setId(nodeId.trim()); return this; } public LiteFlowNodeBuilder setName(String name) { - this.node.setName(name); + if (StrUtil.isBlank(name)){ + return this; + } + this.node.setName(name.trim()); return this; } public LiteFlowNodeBuilder setClazz(String clazz) { - this.node.setClazz(clazz); + if (StrUtil.isBlank(clazz)){ + return this; + } + this.node.setClazz(clazz.trim()); return this; } @@ -103,7 +112,7 @@ public class LiteFlowNodeBuilder { if (StrUtil.isBlank(filePath)){ return this; } - String script = ResourceUtil.readUtf8Str(StrUtil.format("classpath: {}", filePath)); + String script = ResourceUtil.readUtf8Str(StrUtil.format("classpath: {}", filePath.trim())); return setScript(script); }