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] 对象中的List<Long> 字段,反序列化报错 #539

Closed
HsinDumas opened this issue Jul 9, 2022 · 2 comments
Closed

[BUG] 对象中的List<Long> 字段,反序列化报错 #539

HsinDumas opened this issue Jul 9, 2022 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@HsinDumas
Copy link

HsinDumas commented Jul 9, 2022

2.0.8版本

     public static void main(String[] args) {
        TestParam param = new TestParam();
        List<Long> list = new ArrayList<>();
        list.add(1L);
        param.setIds(list);
        System.out.println(JSON.parseObject("{\"ids\":[1]}").to(TestParam.class));
    }

Exception in thread "main" java.lang.UnsupportedOperationException: com.alibaba.fastjson2.reader.FieldReaderListInt64
at com.alibaba.fastjson2.reader.ObjectReader.createInstance(ObjectReader.java:37)
at com.alibaba.fastjson2.JSONArray.to(JSONArray.java:938)
at com.alibaba.fastjson2.reader.ObjectReader.createInstance(ObjectReader.java:109)
at com.alibaba.fastjson2.JSONObject.to(JSONObject.java:1190)
at com.mcd.cn.rms.order.core.controller.ComplainController.main(ComplainController.java:36)

@HsinDumas HsinDumas added the bug Something isn't working label Jul 9, 2022
@HsinDumas HsinDumas changed the title [BUG]对象中的List<Long> 字段,反序列化报错 [BUG] 对象中的List<Long> 字段,反序列化报错 Jul 9, 2022
@wenshao wenshao added this to the 2.0.9 milestone Jul 9, 2022
@wenshao
Copy link
Member

wenshao commented Jul 9, 2022

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.9-SNAPSHOT/
问题已经修复,请帮忙用2.0.9-SNAPSHOT验证,2.0.9版本预计明天发布

@wenshao
Copy link
Member

wenshao commented Jul 10, 2022

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

@wenshao wenshao closed this as completed Jul 10, 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