From 9eb8cc31060f25f25298f7643a5bebc05738dd31 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 31 May 2022 15:53:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Derror.log=E6=8A=A5=E9=94=99=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【github#9574,查看metersphere日志文件error.log有报错】https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001009845 --- .../io/metersphere/log/utils/ReflexObjectUtil.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/io/metersphere/log/utils/ReflexObjectUtil.java b/backend/src/main/java/io/metersphere/log/utils/ReflexObjectUtil.java index c1997cbaf8..2e671438eb 100644 --- a/backend/src/main/java/io/metersphere/log/utils/ReflexObjectUtil.java +++ b/backend/src/main/java/io/metersphere/log/utils/ReflexObjectUtil.java @@ -178,25 +178,25 @@ public class ReflexObjectUtil { // 深度对比 else if (StringUtils.equals(module, "API_DEFINITION")) { if (originalColumns.get(i).getColumnName().equals("request")) { - String newValue = newColumns.get(i).getOriginalValue().toString(); - String oldValue = column.getOriginalValue().toString(); + String newValue = Objects.toString(column.getNewValue().toString(), ""); + String oldValue = Objects.toString(column.getOriginalValue(), ""); column.setDiffValue(ApiDefinitionDiffUtil.diff(newValue, oldValue)); } else if (originalColumns.get(i).getColumnName().equals("response")) { - String newValue = newColumns.get(i).getOriginalValue().toString(); - String oldValue = column.getOriginalValue().toString(); + String newValue = Objects.toString(column.getNewValue().toString(), ""); + String oldValue = Objects.toString(column.getOriginalValue(), ""); column.setDiffValue(ApiDefinitionDiffUtil.diffResponse(newValue, oldValue)); } } // 环境全局前后置脚本深度对比 else if(StringUtils.equals(module, "PROJECT_ENVIRONMENT_SETTING")){ if (originalColumns.get(i).getColumnName().equals("config")) { - String newValue = newColumns.get(i).getOriginalValue().toString(); - String oldValue = column.getOriginalValue().toString(); + String newValue = Objects.toString(column.getNewValue().toString(), ""); + String oldValue = Objects.toString(column.getOriginalValue(), ""); column.setDiffValue(ApiTestEnvironmentDiffUtil.diff(newValue, oldValue)); } } else { - String newValue = column.getNewValue().toString(); + String newValue = Objects.toString(column.getNewValue().toString(), ""); if (StringUtils.isNotEmpty(newValue)) { column.setNewValue(newValue.replaceAll("\\n", " ")); }