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

[QUESTION] 2.x com.alibaba.fastjson2.JSONArray cannot be cast to com.alibaba.fastjson.JSONArray #399

Closed
nuoqin opened this issue Jun 2, 2022 · 2 comments
Labels
question Further information is requested
Milestone

Comments

@nuoqin
Copy link

nuoqin commented Jun 2, 2022

为什么在fastjson2这里不采用原先的jsonArray呢?

1.x中 使用类型转换
JSONObject fileJson = JSON.parseObject(jsonStr); JSONArray files = (JSONArray) fileJson.get("files");
更换成2.x后使用上面的代码会出现com.alibaba.fastjson2.JSONArray cannot be cast to com.alibaba.fastjson.JSONArray
是因为格式化代码中的JSONArray 被替换成了com.alibaba.fastjson2.JSONArray。可以再com.alibaba.fastjson2.reader.ObjectReaderImplMap中488行 JSONArray list = new JSONArray();

@nuoqin nuoqin added the question Further information is requested label Jun 2, 2022
@nuoqin nuoqin changed the title [QUESTION] 关于1.x和2.x com.alibaba.fastjson2.JSONArray cannot be cast to com.alibaba.fastjson.JSONArray [QUESTION] 2.x com.alibaba.fastjson2.JSONArray cannot be cast to com.alibaba.fastjson.JSONArray Jun 2, 2022
@wenshao
Copy link
Member

wenshao commented Jun 2, 2022

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.6-SNAPSHOT/

问题已经修复,请帮忙用2.0.6-SNAPSHOT版本验证,2.0.6正式版预计6月5日前发布

@wenshao wenshao added this to the 2.0.6 milestone Jun 2, 2022
@wenshao
Copy link
Member

wenshao commented Jun 4, 2022

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

@wenshao wenshao closed this as completed Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants