!162 feat #I69VAR 优化 node chain 不存在时候的错误提示

Merge pull request !162 from 与或非/issues/2023012001
This commit is contained in:
铂赛东
2023-01-20 08:44:36 +00:00
committed by Gitee

View File

@@ -237,20 +237,19 @@ public class LiteFlowChainELBuilder {
int commaRightIndex = sourceEl.indexOf(attrName + StrUtil.COMMA);
if (commaRightIndex != -1) {
// 需要加上 "EL: " 的长度 4再加上 "^" 的长度 1indexOf 从 0 开始,所以还需要加 1
msg = msg + sourceEl + "\n" + StrUtil.fill("^", CharUtil.SPACE, commaRightIndex + 6, true);
return msg + sourceEl + "\n" + StrUtil.fill("^", CharUtil.SPACE, commaRightIndex + 6, true);
}
int commaLeftIndex = sourceEl.indexOf(StrUtil.COMMA + attrName);
if (commaLeftIndex != -1) {
// 需要加上 "EL: " 的长度 4再加上 "^" 的长度 1再加上 "," 的长度 1indexOf 从 0 开始,所以还需要加 1
msg = msg + sourceEl + "\n" + StrUtil.fill("^", CharUtil.SPACE, commaLeftIndex + 7, true);
return msg + sourceEl + "\n" + StrUtil.fill("^", CharUtil.SPACE, commaLeftIndex + 7, true);
}
// 还有一种特殊情况,就是 EL 表达式中的节点使用 node("a")
int nodeIndex = sourceEl.indexOf(String.format("node(\"%s\")", attrName));
if (nodeIndex != -1) {
// 需要加上 "EL: " 的长度 4再加上 “node("” 长度 6再加上 "^" 的长度 1indexOf 从 0 开始,所以还需要加 1
msg = msg + sourceEl + "\n" + StrUtil.fill("^", CharUtil.SPACE, commaLeftIndex + 12, true);
return msg + sourceEl + "\n" + StrUtil.fill("^", CharUtil.SPACE, commaLeftIndex + 12, true);
}
break;
}
}
} catch (Exception ex) {