-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
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
[BUG][不兼容]解析带有超大数字的json时,fastjson1 直接报错,但是fastjson2却将数字截断,未报错。 #1357
Comments
多大的数字?能提供重现问题的testcase么? |
@Data
@Builder
@NoArgsConstructor
class PersonTest {
private Integer pSsrc;
private String pUserId;
private boolean flag;
private Map<String, String> map;
public PersonTest(int pSsrc, String pUserId, boolean flag, Map<String, String> map) {
super();
this.pSsrc = pSsrc;
this.pUserId = pUserId;
this.flag = flag;
this.map = map;
}
}
String t1 = "{\"flag\":false,\"pSsrc\":6666665678858,\"pUserId\":\"\"}";
PersonTest t2 = com.alibaba.fastjson2.JSON.parseObject(t1, PersonTest.class);
t2 = com.alibaba.fastjson.JSON.parseObject(t1, PersonTest.class); |
wenshao
added a commit
that referenced
this issue
Apr 13, 2023
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.28-SNAPSHOT/ |
还是有问题,譬如2147483666,10270867890这些还是能正常转换Integer,但结果不对 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[BUG][不兼容]解析带有超大数字的json时,fastjson1 直接报错,但是fastjson2却将数字截断,未报错。
The text was updated successfully, but these errors were encountered: