alibaba / fastjson2

🚄 FASTJSON2 is a Java JSON library with excellent performance.
Apache License 2.0
3.79k stars 495 forks source link

Fix non determinism and timezone dependency for issue#3158 #3159

Closed Mukta13 closed 1 day ago

Mukta13 commented 4 days ago

What this PR does / why we need it

This PR fixes non-deterministic behavior in two specific files, ensuring consistent and reliable results across different builds. This resolves issue #3158

Summary of Changes

Testing Instructions

The changes can be validated using the NonDex plugin to simulate non-deterministic behavior:

mvn -pl codegen-test edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.internal.processor.annotation.MapTest#test
mvn -pl codegen-test edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.internal.processor.annotation.MapTest#test1
mvn -pl codegen-test edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.internal.processor.annotation.MapTest#test2
mvn -pl codegen-test edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.alibaba.fastjson2.internal.processor.primitives.DateTypeTest#test

Checklist

codecov-commenter commented 4 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 74.22%. Comparing base (f6cdd54) to head (3701bf7). Report is 37 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3159 +/- ## ============================================ - Coverage 74.27% 74.22% -0.06% - Complexity 23542 23602 +60 ============================================ Files 659 668 +9 Lines 91870 92143 +273 Branches 20539 20602 +63 ============================================ + Hits 68238 68391 +153 - Misses 15240 15317 +77 - Partials 8392 8435 +43 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.