Skip to content
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] 千分符表示的字符串转long失败 #2461

Closed
wenl001 opened this issue Apr 19, 2024 · 3 comments
Closed

[BUG] 千分符表示的字符串转long失败 #2461

wenl001 opened this issue Apr 19, 2024 · 3 comments
Labels
bug Something isn't working fixed
Milestone

Comments

@wenl001
Copy link

wenl001 commented Apr 19, 2024

问题描述

科学计数法字符串转long失败,fastjson可以

环境信息

请填写以下信息:

  • JDK信息: 1.8
  • 版本信息:2.0.46

重现步骤

如何操作可以重现该问题:

1、字符串: String channelRespBody="{"openTime":"1,659,597,865","startTime":1712903332573 }";
2、待转类型: private Long openTime;

期待的正确结果

openTime = 1,659597865

相关日志输出

请复制并粘贴任何相关的日志输出。
Exception in thread "main" com.alibaba.fastjson2.JSONException: parseLong error, value : 1,659,597,865
at com.alibaba.fastjson2.JSONReader.toInt64(JSONReader.java:3133)
at com.alibaba.fastjson2.JSONReader.getInt64(JSONReader.java:984)
at com.alibaba.fastjson2.JSONReaderUTF16.readInt64(JSONReaderUTF16.java:3144)
at com.alibaba.fastjson2.reader.ORG_1_22_EeCheckIbanBo.readObject(Unknown Source)
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:726)
at com.kucoin.wallet.chaincommon.pay.test.TestFastjson.main(TestFastjson.java:52)

附加信息

如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。

@wenl001 wenl001 added the bug Something isn't working label Apr 19, 2024
@wenl001 wenl001 changed the title [BUG] [BUG] 科学计数法字符串转long失败 Apr 19, 2024
@wenl001 wenl001 changed the title [BUG] 科学计数法字符串转long失败 [BUG] 千分符表示的字符串转long失败 Apr 19, 2024
@wenshao wenshao added this to the 2.0.50 milestone Apr 19, 2024
@wenshao
Copy link
Member

wenshao commented Apr 19, 2024

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.50-SNAPSHOT/
问题已修复,请帮忙用2.0.50-SNAPSHOT版本验证

@wenshao wenshao added the fixed label Apr 19, 2024
@wenshao
Copy link
Member

wenshao commented May 12, 2024

https://github.com/alibaba/fastjson2/releases/tag/2.0.50
2.0.50已发布,请用新版本

@wenshao wenshao closed this as completed May 12, 2024
@wu979
Copy link

wu979 commented Oct 16, 2024

{"content":"jonathan.yue Apply to join the organization","extra":{"relationId":200,000,000,002,005,"orgId":"rxDDjvGQmUyYrPom","subType":"JOIN_APPLY"},"push":{"content":"jonathan.yue Apply to join the organization","params":{"relationId":200,000,000,002,005,"orgId":"rxDDjvGQmUyYrPom","subType":"JOIN_APPLY"},"subject":"Organizational Reminder","type":"ORG_MEM"},"subject":"Organizational Reminder","type":"ORG_MEM"}

2.0.9 由于科学计数法的原因,升级到了2.0.50,报了新的错误
syntax error, illegal key-value, offset 88, character 0, line 1, column 88, fastjson-version 2.0.53 {"content":"jonathan.yue Apply to join the organization","extra":{"relationId":200,000,000,002,005,"orgId":"rxDDjvGQmUyYrPom","subType":"JOIN_APPLY"},"push":{"content":"jonathan.yue Apply to join the organization","params":{"relationId":200,000,000,002,005,"orgId":"rxDDjvGQmUyYrPom","subType":"JOIN_APPLY"},"subject":"Organizational Reminder","type":"ORG_MEM"},"subject":"Organizational Reminder","type":"ORG_MEM"}
升级到2.0.53还是同样的问题

@wenshao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

3 participants