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] #425

Closed
2594726366 opened this issue Jun 7, 2022 · 2 comments
Closed

[BUG] #425

2594726366 opened this issue Jun 7, 2022 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@2594726366
Copy link

问题描述

设备采集过来的数据 会有正负号,负号没问题 就是数据有+号时转换成数字报错

重现步骤

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

  1. JSONObject.parseObject(bb,xxx.class);
  2. xxx包含Float型等
  3. com.alibaba.fastjson2.JSONException: parseLong error, value : +000.00

期待的正确结果

对您期望发生的结果进行清晰简洁的描述。
加上+可以解析正数

相关日志输出

com.alibaba.fastjson2.JSONException: parseLong error, value : +000.00
at com.alibaba.fastjson2.JSONReader.toInt64(JSONReader.java:1658)
at com.alibaba.fastjson2.JSONReader.getNumber(JSONReader.java:1565)
at com.alibaba.fastjson2.JSONReader.readNumber(JSONReader.java:642)
at com.alibaba.fastjson2.JSONReader.readFloat(JSONReader.java:617)
at com.alibaba.fastjson2.reader.FieldReaderFloatMethod.readFieldValue(FieldReaderFloatMethod.java:19)
at com.alibaba.fastjson2.reader.ObjectReaderBean.readObject(ObjectReaderBean.java:174)
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:258)

@2594726366 2594726366 added the bug Something isn't working label Jun 7, 2022
wenshao added a commit that referenced this issue Jun 7, 2022
@wenshao
Copy link
Member

wenshao commented Jun 7, 2022

@wenshao wenshao added this to the 2.0.7 milestone Jun 7, 2022
@wenshao
Copy link
Member

wenshao commented Jun 11, 2022

https://github.com/alibaba/fastjson2/releases/tag/2.0.7
问题已经修复,请用新版本

@wenshao wenshao closed this as completed Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants