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

用JSONObject.parseArray反序列化非静态内部类时,异常信息有误 #2358

Closed
Horanol opened this issue Apr 8, 2019 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@Horanol
Copy link
Contributor

Horanol commented Apr 8, 2019

以下代码可复现

public class TestJson {
@NoArgsConstructor
@DaTa
public class TestJson2 {
private String test1;
private String test2;
}
public static void main(String args[]) {
String str = "[{\n" +
" "test1":"1",\n" +
" "test2":"2"\n" +
"},\n" +
" {\n" +
" "test1":"1",\n" +
" "test2":"2"\n" +
" }]";
List testJson2 = JSONObject.parseArray(str, TestJson2.class);
}
}

此时报错信息为
com.alibaba.fastjson.JSONException: create instance error, class com.meituan.evaluation.config.TestJson$TestJson2
实际上应该报 can't create non-static inner class instance.

Horanol added a commit to Horanol/fastjson that referenced this issue Apr 8, 2019
wenshao added a commit that referenced this issue Apr 10, 2019
wenshao added a commit that referenced this issue Apr 10, 2019
@wenshao wenshao added this to the 1.2.57 milestone Apr 10, 2019
@wenshao wenshao added the bug label Apr 10, 2019
@wenshao wenshao self-assigned this Apr 11, 2019
@wenshao
Copy link
Member

wenshao commented Apr 11, 2019

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

@wenshao wenshao closed this as completed Apr 11, 2019
@xuchenchen
Copy link

此版本VIVOX9S Plus 7.1.2闪退

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants