[Fix] Fix the JSONUtils tool class time zone problem #10282#10284
[Fix] Fix the JSONUtils tool class time zone problem #10282#10284caishunfeng merged 5 commits intoapache:devfrom 106umao:fix#10282
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #10284 +/- ##
=========================================
Coverage 40.85% 40.86%
- Complexity 4843 4844 +1
=========================================
Files 885 885
Lines 35974 35976 +2
Branches 3993 3993
=========================================
+ Hits 14698 14700 +2
Misses 19820 19820
Partials 1456 1456
Continue to review full report at Codecov.
|
|
Hi @SbloodyS @zhuangchong |
|
The issue had been fixed #10345 |
So we do not need this anymore, is it? |
|
@zhongjiajie |
The reason of still failed is that the github action's host machine's timezone is UTC by default. But your local timezone is not. |
|
@SbloodyS |
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java
Outdated
Show resolved
Hide resolved
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/JSONUtils.java
Outdated
Show resolved
Hide resolved
As @SbloodyS said, I think we need this pr. @106umao please solve the conflicts, thanks. |
|
Hi @106umao , I have noticed that many CI failed for this reason. So I helped you solve the conflict and optimize it. Hoped you don't mind. |
add timezone import
|
Kudos, SonarCloud Quality Gate passed! |
@SbloodyS @caishunfeng thx. |
…ache#10284) * [Fix] Fix the JSONUtils tool class time zone problem apache#10282 * [Fix] Fix the JSONUtils tool class time zone problem apache#10282 * Update JSONUtils.java remove unnessnary log * Update JSONUtilsTest.java add timezone import Co-authored-by: xiangzihao <460888207@qq.com>
…ache#10284) * [Fix] Fix the JSONUtils tool class time zone problem apache#10282 * [Fix] Fix the JSONUtils tool class time zone problem apache#10282 * Update JSONUtils.java remove unnessnary log * Update JSONUtilsTest.java add timezone import Co-authored-by: xiangzihao <460888207@qq.com>










Purpose of the pull request
Fixed #10282
Brief change log
Add static method
setTimeZone(TimeZone timeZone)for classorg.apache.dolphinscheduler.common.utils.JSONUtilsThe purpose of the method is to support dynamic modification of the TimeZone setting of the ObjectMapper object
Verify this pull request
This pull request is already covered by existing tests, such as (please describe tests).
method
org.apache.dolphinscheduler.common.utils.JSONUtilsTest#dateToStringmethod
org.apache.dolphinscheduler.common.utils.JSONUtilsTest#stringToDateThis change added tests and can be verified as follows:
Run
mvn clean testin terminal