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]使用JSONObject.parseObject时,会修改key值 #1734

Closed
shadow-dust opened this issue Aug 14, 2023 · 3 comments
Closed

[BUG]使用JSONObject.parseObject时,会修改key值 #1734

shadow-dust opened this issue Aug 14, 2023 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@shadow-dust
Copy link

问题描述

将fastjson版本从1.2.73升级到2.0.38后,原本正常的parseObject会出现key值错误的情况

环境信息

请填写以下信息:

  • OS信息: [Windows 10]
  • JDK信息: [jdk 1.8.0_291]
  • 版本信息:[Fastjson2 2.0.38]

重现步骤

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

  1. 使用 `JSONObject.parseObject 方法
  2. 输入 json字符串 数据
  3. 出现 key值“access_token” 解析成“aceess_token” 错误
String result = HttpUtil.post(BASE_OAUTH_URL + "token", header, params);
JSONObject tokenObj = JSONObject.parseObject(result);

期待的正确结果

tokenObj={access_token: "", refresh_token: "", token_type: "", expires_in: 3600}

附加信息

解析出来的JSONObject对象
b62c54aadeec712e5ea1da7da7a9ee7
JSON字符串
25ee035f626b6d096cb26eea9ec71cb

@shadow-dust shadow-dust added the bug Something isn't working label Aug 14, 2023
@wenshao
Copy link
Member

wenshao commented Aug 14, 2023

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.39-SNAPSHOT/
问题已修复,该问题仅在JDK 8下存在,请帮忙用2.0.39-SNAPSHOT版本验证,2.0.39版本预计在8月20日前发布(或者最近两天)

@wenshao wenshao added this to the 2.0.39 milestone Aug 15, 2023
@wenshao
Copy link
Member

wenshao commented Aug 15, 2023

@wenshao wenshao closed this as completed Aug 15, 2023
@shadow-dust
Copy link
Author

已解决,谢谢

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