From 596df7c6e3b9c5ba88b969a7342bc912b60aa9e1 Mon Sep 17 00:00:00 2001 From: zhangshancheng <0170993158> Date: Tue, 27 Jan 2026 19:14:17 +0800 Subject: [PATCH 1/4] fix Modify HttpSender.bodyParams generic type to Map --- .../dolphinscheduler/plugin/alert/http/HttpSender.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java index 42f1474de47c..35b201b7848f 100644 --- a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java +++ b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java @@ -42,7 +42,7 @@ public final class HttpSender { private Map headerParams; private OkHttpRequestHeaderContentType contentType; - private Map bodyParams; + private Map bodyParams; private HttpRequestMethod requestType; private int timeout; private String url; @@ -69,7 +69,7 @@ private void paramsValidator(Map paramsMap) { String bodyParamsString = paramsMap.get(HttpAlertConstants.NAME_BODY_PARAMS); if (StringUtils.isNotBlank(bodyParamsString)) { - bodyParams = JSONUtils.toMap(bodyParamsString); + bodyParams = JSONUtils.parseObject(bodyParamsString, new TypeReference>() {}); if (bodyParams == null) { throw new IllegalArgumentException("bodyParams is not a valid json"); } @@ -215,6 +215,7 @@ private void setMsgInRequestBody(String msg) { } bodyParams.forEach((key, value) -> { + String valueOf = String.valueOf(value); if (value.contains(HttpAlertConstants.MSG_PARAMS)) { bodyParams.put(key, value.replace(HttpAlertConstants.MSG_PARAMS, msg)); } From 95b1863a9b91159600593eefad1ff419aa79813d Mon Sep 17 00:00:00 2001 From: zhangshancheng <0170993158> Date: Wed, 28 Jan 2026 17:06:58 +0800 Subject: [PATCH 2/4] run mvn spotless:apply to format the code --- .../dolphinscheduler/plugin/alert/http/HttpSender.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java index 35b201b7848f..2a1636e2b6a0 100644 --- a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java +++ b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java @@ -69,7 +69,8 @@ private void paramsValidator(Map paramsMap) { String bodyParamsString = paramsMap.get(HttpAlertConstants.NAME_BODY_PARAMS); if (StringUtils.isNotBlank(bodyParamsString)) { - bodyParams = JSONUtils.parseObject(bodyParamsString, new TypeReference>() {}); + bodyParams = JSONUtils.parseObject(bodyParamsString, new TypeReference>() { + }); if (bodyParams == null) { throw new IllegalArgumentException("bodyParams is not a valid json"); } @@ -215,7 +216,7 @@ private void setMsgInRequestBody(String msg) { } bodyParams.forEach((key, value) -> { - String valueOf = String.valueOf(value); + String valueOf = String.valueOf(value); if (value.contains(HttpAlertConstants.MSG_PARAMS)) { bodyParams.put(key, value.replace(HttpAlertConstants.MSG_PARAMS, msg)); } From 6608c633b67398411af304f43c22f413d2f48052 Mon Sep 17 00:00:00 2001 From: zhangshancheng <0170993158> Date: Wed, 28 Jan 2026 18:00:22 +0800 Subject: [PATCH 3/4] [Fix-17912] Fix add import of TypeReference --- .../apache/dolphinscheduler/plugin/alert/http/HttpSender.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java index 2a1636e2b6a0..715336506293 100644 --- a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java +++ b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java @@ -37,6 +37,8 @@ import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; +import com.fasterxml.jackson.core.type.TypeReference; + @Slf4j public final class HttpSender { From e872f5124ef325dc6d0575a1daa8115eec884d93 Mon Sep 17 00:00:00 2001 From: zhangshancheng <0170993158> Date: Wed, 28 Jan 2026 18:24:04 +0800 Subject: [PATCH 4/4] [Fix-17912] Modification method: org.apache.dolphinscheduler.plugin.alert.http.HttpSender#setMsgInRequestBody is compatible with Map --- .../apache/dolphinscheduler/plugin/alert/http/HttpSender.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java index 715336506293..90280e802020 100644 --- a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java +++ b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java @@ -219,8 +219,8 @@ private void setMsgInRequestBody(String msg) { bodyParams.forEach((key, value) -> { String valueOf = String.valueOf(value); - if (value.contains(HttpAlertConstants.MSG_PARAMS)) { - bodyParams.put(key, value.replace(HttpAlertConstants.MSG_PARAMS, msg)); + if (valueOf.contains(HttpAlertConstants.MSG_PARAMS)) { + bodyParams.put(key, valueOf.replace(HttpAlertConstants.MSG_PARAMS, msg)); } }); }