#199 Mapping a map with a null value fails

Dozer v5.1
closed-fixed
nobody
5
2009-06-08
2009-06-03
No

Hi, I have a simple class with just one field: HashMap.
Mapping works when there is no null values. But when there is one, all other values are missing.

I found the cause of this issue (return statement):
Class MappingProcessor (revision 924) line 528 (method mapMap)

There is:

if (srcEntryValue == null) { // overwrites with null in any case
result.put(srcEntry.getKey(), null);
return result;
}

Should be:

if (srcEntryValue == null) { // overwrites with null in any case
result.put(srcEntry.getKey(), null);
continue;
}

So "continue" instead of "return result".

Discussion

  • dmitry (lv)

    dmitry (lv) - 2009-06-08

    fixed by a submitted patch

     
  • dmitry (lv)

    dmitry (lv) - 2009-06-08
    • milestone: 888640 --> Dozer v5.1
    • status: open --> 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