-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Milestone
Description
The following code, called on Jackson Jr. 2.6.3
JSON.std.with(JSON.Feature.READ_JSON_ARRAYS_AS_JAVA_ARRAYS)
.arrayOfFrom(Object.class, "[]");
crashes with the following exception
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Object[]
at com.fasterxml.jackson.jr.ob.impl.JSONReader.readArrayOf(JSONReader.java)
at com.fasterxml.jackson.jr.ob.JSON.arrayOfFrom(JSON.java)
However, if I remove the feature and ask Jackson Jr. to read a list from the JSON array by using listOfFrom
, everything works fine.
Since even calling arrayOfFrom
without the feature does not work (which I presume is due to JSON arrays indeed being read as Java List
s... but, then, what's the purpose of the arrayOfFrom
method?), how else I am supposed to make Jackson Jr. return me a Java array from a JSON array?
Metadata
Metadata
Assignees
Labels
No labels