This is a follow up to the bug and subsequent patch --> NullPointerException when mapping single fields to List - ID: 3157966
The patch correctly determines the type for Collections that have a defined type via Java 1.5 Generics, but does not account for the reverse mapping of untyped Collections, even with the presence of the deep-index-hint in the mapping configuration. The attached patch adds another null check after attempting to get the type from the Generic Collection. If the type is still null at this point, I believe it can be assumed that this is an untyped collection, and the first listed class as the deep-index-hint will be used as the type. The patch also contains log warnings when using the deep-index-mapping on an untyped collection - but remove if they aren't thought necessary.
Attached is a patch file with changes to org.dozer.propertydescriptor.GetterSetterPropertyDescriptor.java, as well as a test case, required pojo classes, and example mapping file for test case.
Log in to post a comment.