You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JSONArrayarray = JSON.parseArray("[\"a\",\"b\",\"c\"]");
List<String> list = array.toJavaList(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.fastjson.JSONArray.toJavaList(JSONArray.java:817)
at TestFastJson.main(TestFastJson.java:26)
附加信息
The text was updated successfully, but these errors were encountered:
fastjson1-compatible class cannot be converted to same class.
当JSONArray内部元素类型与转换的目标类型相同时,toJavaList()会转换失败抛出异常。
环境信息
重现步骤
期待的正确结果
正常转换不报错。
相关日志输出
附加信息
The text was updated successfully, but these errors were encountered: