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]JSON.parseObject把字符串转换为对象的时候出现多余的前缀,使用小于等于2.0.33的版本就是正常的 #1735

Closed
523219809 opened this issue Aug 14, 2023 · 7 comments
Labels
bug Something isn't working fixed
Milestone

Comments

@523219809
Copy link

问题描述

Joson字符串转换的时候会出现多余的字符串

环境信息

  • OS信息: [e.g.:window11
  • JDK信息: [e.g.:Openjdk 14
  • 版本信息:[e.g.:Fastjson2.0.38

重现步骤

1、下面这段Json字符串转换后DG_GridColumn下面的FIELDNAME就变成了PKFIELDNAME

2、如果USERNAME设置为空或者删掉这个字段就能正常显示。

var Json = "{"DG_GridMain":[{"PKFIELDNAME":"USERID","USERNAME":"测试"}],"DG_GridColumn":[{"FIELDNAME":"USERID"}]}";
var JsonObj = JSON.parseObject(Json);
发生问题的图如下,这个箭头不应该是这样的应该是没有PK的:
image
使用小于等于2.0.33的版本就是正常的:
image

期待的正确结果

希望别在有多余的东西出现。

@523219809 523219809 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/
请帮忙用2.0.39-SNAPSHOT版本验证问题是否还存在,2.0.39版本预计在8月20日前发布(或者最近两天)

@523219809
Copy link
Author

523219809 commented Aug 14, 2023 via email

@wenshao
Copy link
Member

wenshao commented Aug 14, 2023

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.39-SNAPSHOT/
请帮忙更新快照用2.0.39-SNAPSHOT版本再验证一次看问题是否还存在,该问题只在JDK 8下会存在。

@523219809
Copy link
Author

523219809 commented Aug 14, 2023 via email

@523219809
Copy link
Author

523219809 commented Aug 14, 2023 via email

@wenshao
Copy link
Member

wenshao commented Aug 14, 2023

感谢你帮忙发现这个隐蔽的问题,我会尽快发布新版本修复此问题

wenshao added a commit that referenced this issue Aug 14, 2023
@wenshao wenshao added this to the 2.0.39 milestone Aug 15, 2023
@wenshao wenshao added the fixed label Aug 15, 2023
@wenshao
Copy link
Member

wenshao commented Aug 15, 2023

@wenshao wenshao closed this as completed Aug 15, 2023
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

2 participants