We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Result result = JSON.parseObject(str, new TypeReference<Result>(){});
2.x 中这么使用反序列化(包含泛型)时 IDEA 提示下面的错误,请教 2.x 如何处理这块 ?感谢!
无法解析方法'parseObject(java.lang.String, anonymous com.alibaba.fastjson2.TypeReference<com.william.mall.common.model.Result<com.william.mall.common.model.TestUser>>)'
The text was updated successfully, but these errors were encountered:
String str = "{}"; Result result = JSON.parseObject(str, new TypeReference<Result>(){}.getType()); assertNotNull(result);
可以先通过上面的方法解决,下一个版本2.0.2会直接支持传入TypeReference
Sorry, something went wrong.
thanks 大佬 ~
2.0.2预计5月3日前发布
https://github.com/alibaba/fastjson2/releases/tag/2.0.2 问题已修复,请使用新版本
No branches or pull requests
Result result = JSON.parseObject(str, new TypeReference<Result>(){});
2.x 中这么使用反序列化(包含泛型)时 IDEA 提示下面的错误,请教 2.x 如何处理这块 ?感谢!
无法解析方法'parseObject(java.lang.String, anonymous com.alibaba.fastjson2.TypeReference<com.william.mall.common.model.Result<com.william.mall.common.model.TestUser>>)'
The text was updated successfully, but these errors were encountered: