Situation: A bean with a Map<String,Object>. The Map contains objects of various types, including an ArrayList.
Result: All values mapped after the ArrayList has been mapped are incorrectly converted to java.lang.String
Expected Result: All values are mapped 1:1 to their original type, including the ArrayList.
Analysis: The ArrayList object in the Map causes mapCollection() to set a destination type hint into the FieldMap. It uses java.lang.String (taken from the Map's generic type of the key?!?!) as the hint. The same FieldMap is then used for the rest of the entries in the Map. All the entries are converted to Strings.
Test case attached.
Log in to post a comment.