We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Integer.MAX_VALUE+3L, Integer.MAX_VALUE*2L+1]该区间的数,从String反序列化到BigDecimal转换不正确,正数变为负数。 2.0.8版本有这个问题。但测试了fastjson1.2.76是没问题的。
public class TestJson { public static void main(String[] args) { A a = new A(); a.num=Integer.MAX_VALUE+3L+""; B b = JSONObject.parseObject(JSONObject.toJSONString(a), B.class); System.out.println(a.num); System.out.println(b.num); } } @Data class A{ String num; } @Data class B{ BigDecimal num; }
2147483650 2147483650
2147483650 -2147483646
The text was updated successfully, but these errors were encountered:
修改问题格式
Sorry, something went wrong.
bug fix for readDecimal, for issue #540
a91d49b
01bc340
https://github.com/alibaba/fastjson2/releases/tag/2.0.9 问题已修复,请用新版本
这个问题是我发现的,数据也是我的
No branches or pull requests
问题描述:
[Integer.MAX_VALUE+3L, Integer.MAX_VALUE*2L+1]该区间的数,从String反序列化到BigDecimal转换不正确,正数变为负数。
2.0.8版本有这个问题。但测试了fastjson1.2.76是没问题的。
测试代码:
期待的正确结果
2147483650
2147483650
相关日志输出
2147483650
-2147483646
The text was updated successfully, but these errors were encountered: