From 09a755ebdecccc56687bdd47f1c5bd99a564478d Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Thu, 13 Oct 2022 11:04:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=BD=ACjson=E6=97=B6boolean=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=9A=84=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/metersphere/commons/utils/JSONUtil.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api-test/backend/src/main/java/io/metersphere/commons/utils/JSONUtil.java b/api-test/backend/src/main/java/io/metersphere/commons/utils/JSONUtil.java index 771671353d..385c2d6699 100644 --- a/api-test/backend/src/main/java/io/metersphere/commons/utils/JSONUtil.java +++ b/api-test/backend/src/main/java/io/metersphere/commons/utils/JSONUtil.java @@ -85,6 +85,8 @@ public class JSONUtil { typeObj = Integer.class.getConstructor(int.class).newInstance(10); } else if (StringUtils.containsIgnoreCase(typeClazz.getSimpleName(), "Map")) { typeObj = LinkedHashMap.class.getConstructor().newInstance(); + } else if (StringUtils.containsIgnoreCase(typeClazz.getSimpleName(), PropertyConstant.BOOLEAN)) { + typeObj = Boolean.class.getConstructor(boolean.class).newInstance(false); } else { typeObj = typeClazz.getDeclaredConstructor().newInstance(); }