From a930f6d14b63e203ef604492c770ae3db19e2c82 Mon Sep 17 00:00:00 2001 From: Zaki <91261012+cnzakii@users.noreply.github.com> Date: Wed, 10 Apr 2024 10:50:29 +0800 Subject: [PATCH] [ISSUE #4814] Migrate from fastjson 1.2.83 to fastjson2 (#4819) * [Enhancement] Migrate from fastjson 1.2.83 to fastjson2 #4814 * fix_dependencies_problem * fix_check --- build.gradle | 1 - .../eventmesh-connector-prometheus/build.gradle | 2 +- .../source/connector/PrometheusSourceConnector.java | 4 ++-- eventmesh-connectors/eventmesh-connector-wechat/build.gradle | 2 +- .../connector/wechat/sink/connector/WeChatSinkConnector.java | 4 ++-- eventmesh-runtime/build.gradle | 2 +- tools/dependency-check/known-dependencies.txt | 2 +- tools/third-party-licenses/LICENSE | 2 +- 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 424c9cc004..3cd8460b9a 100644 --- a/build.gradle +++ b/build.gradle @@ -569,7 +569,6 @@ subprojects { dependency "org.projectlombok:lombok:1.18.22" dependency "com.github.seancfoley:ipaddress:5.3.3" dependency "javax.annotation:javax.annotation-api:1.3.2" - dependency "com.alibaba:fastjson:1.2.83" // TODO migrate to fastjson2 dependency "com.alibaba.fastjson2:fastjson2:2.0.48" dependency "software.amazon.awssdk:s3:2.20.29" diff --git a/eventmesh-connectors/eventmesh-connector-prometheus/build.gradle b/eventmesh-connectors/eventmesh-connector-prometheus/build.gradle index d92797a8c4..9650575803 100644 --- a/eventmesh-connectors/eventmesh-connector-prometheus/build.gradle +++ b/eventmesh-connectors/eventmesh-connector-prometheus/build.gradle @@ -19,7 +19,7 @@ dependencies { implementation project(":eventmesh-openconnect:eventmesh-openconnect-java") implementation 'org.apache.httpcomponents:httpclient' implementation 'com.github.rholder:guava-retrying' - implementation 'com.alibaba:fastjson' + implementation 'com.alibaba.fastjson2:fastjson2' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' } \ No newline at end of file diff --git a/eventmesh-connectors/eventmesh-connector-prometheus/src/main/java/org/apache/eventmesh/connector/prometheus/source/connector/PrometheusSourceConnector.java b/eventmesh-connectors/eventmesh-connector-prometheus/src/main/java/org/apache/eventmesh/connector/prometheus/source/connector/PrometheusSourceConnector.java index 0fe5c87576..2c75f394fc 100644 --- a/eventmesh-connectors/eventmesh-connector-prometheus/src/main/java/org/apache/eventmesh/connector/prometheus/source/connector/PrometheusSourceConnector.java +++ b/eventmesh-connectors/eventmesh-connector-prometheus/src/main/java/org/apache/eventmesh/connector/prometheus/source/connector/PrometheusSourceConnector.java @@ -44,8 +44,8 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; import com.github.rholder.retry.Attempt; import com.github.rholder.retry.RetryListener; import com.github.rholder.retry.Retryer; diff --git a/eventmesh-connectors/eventmesh-connector-wechat/build.gradle b/eventmesh-connectors/eventmesh-connector-wechat/build.gradle index c791524485..9a73345d1d 100644 --- a/eventmesh-connectors/eventmesh-connector-wechat/build.gradle +++ b/eventmesh-connectors/eventmesh-connector-wechat/build.gradle @@ -26,7 +26,7 @@ dependencies { implementation project(":eventmesh-sdks:eventmesh-sdk-java") implementation project(":eventmesh-openconnect:eventmesh-openconnect-java") - implementation 'com.alibaba:fastjson' + implementation 'com.alibaba.fastjson2:fastjson2' implementation 'com.google.guava:guava' implementation 'com.squareup.okhttp3:okhttp' diff --git a/eventmesh-connectors/eventmesh-connector-wechat/src/main/java/org/apache/eventmesh/connector/wechat/sink/connector/WeChatSinkConnector.java b/eventmesh-connectors/eventmesh-connector-wechat/src/main/java/org/apache/eventmesh/connector/wechat/sink/connector/WeChatSinkConnector.java index 1d1c3258cb..ac66ec45cc 100644 --- a/eventmesh-connectors/eventmesh-connector-wechat/src/main/java/org/apache/eventmesh/connector/wechat/sink/connector/WeChatSinkConnector.java +++ b/eventmesh-connectors/eventmesh-connector-wechat/src/main/java/org/apache/eventmesh/connector/wechat/sink/connector/WeChatSinkConnector.java @@ -32,8 +32,8 @@ import java.util.Objects; import java.util.concurrent.TimeUnit; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; diff --git a/eventmesh-runtime/build.gradle b/eventmesh-runtime/build.gradle index eef0bb2f92..95924faad4 100644 --- a/eventmesh-runtime/build.gradle +++ b/eventmesh-runtime/build.gradle @@ -27,7 +27,7 @@ dependencies { implementation "org.apache.httpcomponents:httpclient" implementation 'io.netty:netty-all' - implementation "com.alibaba:fastjson" + implementation "com.alibaba.fastjson2:fastjson2" implementation 'com.github.seancfoley:ipaddress' diff --git a/tools/dependency-check/known-dependencies.txt b/tools/dependency-check/known-dependencies.txt index 4cedc91657..b30ca5d5ed 100644 --- a/tools/dependency-check/known-dependencies.txt +++ b/tools/dependency-check/known-dependencies.txt @@ -78,7 +78,7 @@ endpoints-spi-2.20.29.jar error_prone_annotations-2.9.0.jar eventstream-1.0.1.jar failureaccess-1.0.1.jar -fastjson-1.2.83.jar +fastjson-1.2.69_noneautotype.jar fastjson2-2.0.48.jar gateway-dingtalk-1.0.2.jar google-auth-library-credentials-0.22.2.jar diff --git a/tools/third-party-licenses/LICENSE b/tools/third-party-licenses/LICENSE index de086f4883..20c482188e 100644 --- a/tools/third-party-licenses/LICENSE +++ b/tools/third-party-licenses/LICENSE @@ -251,7 +251,7 @@ The text of each license is also included at licenses/LICENSE-[project].txt. error_prone_annotations 2.7.1: https://github.com/google/error-prone, Apache 2.0 failureaccess 1.0.1: https://github.com/google/guava, Apache 2.0 listenablefuture 9999.0-empty-to-avoid-conflict-with-guava: https://github.com/google/guava, Apache 2.0 - fastjson 1.2.83: https://github.com/alibaba/fastjson, Apache 2.0 + fastjson2 2.0.48: https://github.com/alibaba/fastjson2, Apache 2.0 guava 31.0.1-jre: https://github.com/google/guava, Apache 2.0 gateway-dingtalk 1.0.2: https://github.com/aliyun/alibabacloud-gateway, Apache 2.0 guice 4.2.2: https://github.com/google/guice, Apache 2.0