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] JSONArray toList 不支持String.class等 #316

Closed
abao365 opened this issue May 23, 2022 · 2 comments
Closed

[BUG] JSONArray toList 不支持String.class等 #316

abao365 opened this issue May 23, 2022 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@abao365
Copy link

abao365 commented May 23, 2022

代码如下 1.0可以正常运行,2.0不可以
JSONArray arr = new JSONArray();
arr.add("A");
arr.add("B");
System.out.println(arr.toList(String.class));

错误如下
Exception in thread "main" com.alibaba.fastjson2.JSONException: class java.lang.String cannot be converted to class java.lang.String
at com.alibaba.fastjson2.JSONArray.toList(JSONArray.java:995)
at

@abao365 abao365 added the bug Something isn't working label May 23, 2022
@wenshao wenshao added this to the 2.0.5 milestone May 23, 2022
@wenshao
Copy link
Member

wenshao commented May 23, 2022

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/
问题已修复,你可以先用2.0.5-SNAPSHOT验证,预计这个月底会发布正式版本

@wenshao
Copy link
Member

wenshao commented May 28, 2022

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

@wenshao wenshao closed this as completed May 28, 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