From a8e2fb35eced2895cca5dac0f09810a3096c0538 Mon Sep 17 00:00:00 2001 From: luom3 <369433047@qq.com> Date: Wed, 13 Jul 2022 11:31:27 +0800 Subject: [PATCH] =?UTF-8?q?#=20fix=20bug=20SUBSTRING=20plugin=20param=20en?= =?UTF-8?q?d=20index=20#=20=E6=8F=92=E4=BB=B6-=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E6=88=AA=E7=9F=AD,=20=E6=94=AF=E6=8C=81=E5=B0=BE=E5=AD=97?= =?UTF-8?q?=E7=AC=A6.=20eg=EF=BC=9A12345678910=20->=207,11=20->=208910?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/pgmmers/radar/service/impl/engine/plugin/SUBSTRING.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radar-service-impl/src/main/java/com/pgmmers/radar/service/impl/engine/plugin/SUBSTRING.java b/radar-service-impl/src/main/java/com/pgmmers/radar/service/impl/engine/plugin/SUBSTRING.java index 082e29d..e25f397 100644 --- a/radar-service-impl/src/main/java/com/pgmmers/radar/service/impl/engine/plugin/SUBSTRING.java +++ b/radar-service-impl/src/main/java/com/pgmmers/radar/service/impl/engine/plugin/SUBSTRING.java @@ -30,7 +30,7 @@ public Object handle(PreItemVO item, Map jsonInfo, String[] sour String field = jsonInfo.get(sourceField[0]).toString(); int start =Integer.parseInt(args[0]); int end = Integer.parseInt(args[1]); - if (field != null && field.length() > end) { + if (field != null && (field.length() > end || field.length() == end)) { return field.substring(start, end); } else { return field;