#311 deep index mapping for untyped Collection

Dozer v5.3.3

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.


  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2011-03-05

    patch and test case

  • dmitry (lv)

    dmitry (lv) - 2011-10-09
    • milestone: 1331587 --> Dozer v5.3.3
    • assigned_to: nobody --> buzdin
    • status: open --> closed-fixed
  • dmitry (lv)

    dmitry (lv) - 2011-10-09

    fixed by patch.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks