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

对泛型类的转换有点问题 #7

Closed
qiaokang opened this issue Dec 17, 2016 · 4 comments
Closed

对泛型类的转换有点问题 #7

qiaokang opened this issue Dec 17, 2016 · 4 comments

Comments

@qiaokang
Copy link

java.lang.RuntimeException: unsupported type: T

@taowen
Copy link
Contributor

taowen commented Dec 17, 2016

给一段完整的复现问题的源代码

@qiaokang
Copy link
Author

jsonBean.zip
将context.json转换为ProductAdvertList对象的时候,报异常java.lang.RuntimeException: unsupported type: T

taowen added a commit that referenced this issue Dec 21, 2016
@taowen
Copy link
Contributor

taowen commented Dec 21, 2016

@qiaokang 现在已经ok了,你再试试看

@qiaokang
Copy link
Author

谢谢@taowen ,顺利解析。
我发现json的值类型与bean的属性类型必须强一致,例如值类型是数字,对应bean的属性类型如果是String,会报解析异常,类型不匹配。
意外的惊喜,原来一直使用GSON,类型没有匹配。

jodooi referenced this issue in dd2480-group14-2024/java Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants