#348 Mapping null values within List<>List mapping causes NPE

Dozer v5.3.3
closed-fixed
5
2014-09-16
2011-09-14
Anonymous
No

See: https://sourceforge.net/projects/dozer/forums/forum/452530/topic/4706621

I looked at the source and figured out, that looking up converters dies with NPE when the src value is null while mapping List<>List.
It can't recognize the type of the destination properly. What the patch does:

- first, try to use the last found dest type (as before)
- if not found, try to get the dest object type from dest hint (new)
- if not found, try to get the dest object type from src hint (as before)

In addition I added missing support for map-null attribute. It's now respected correctly.
I've seen that Set's have similar problems but I didn't patch them too.

After applying the patch, all testcases are still valid.

Please review the patch and if you find it useful, please apply it to Sets as well and
integrate it in the next version.

Thanks
Veit

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-09-14

    Fixes null handling within Lists and respects map-null="true|false"

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-09-14

    Seemed to be a mapping error. After correcting the mapping the error didn't occur again. Sorry for the inconvenience.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2011-09-14
    • status: open --> wont-fix-rejected
     
  • dmitry (lv)

    dmitry (lv) - 2011-10-09

    fixed in trunk

     
  • dmitry (lv)

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

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks