#131 NullPointerException in mapMap (mapping a map)

Dozer v.4.3
closed-fixed
None
5
2008-10-30
2008-02-01
No

I am trying to use dozer to map a hibernate model to a DTO model. The hibernate mappings use dynamic-component, which creates a java.util.Map that contains name=value pairs--but many of the values are null. The source for mapMap is incorrectly doing a .getClass() on the value while iterating the map--assuming the value is not null. In this case, dozer should simply insert a null value in the target map.

Stacktrace is here:

java.lang.NullPointerException
at net.sf.dozer.util.mapping.MappingProcessor.mapMap(MappingProcessor.java:540)
at net.sf.dozer.util.mapping.MappingProcessor.mapOrRecurseObject(MappingProcessor.java:367)
at net.sf.dozer.util.mapping.MappingProcessor.mapFromFieldMap(MappingProcessor.java:309)
at net.sf.dozer.util.mapping.MappingProcessor.mapField(MappingProcessor.java:255)
at net.sf.dozer.util.mapping.MappingProcessor.map(MappingProcessor.java:224)
at net.sf.dozer.util.mapping.MappingProcessor.mapCustomObject(MappingProcessor.java:451)
at net.sf.dozer.util.mapping.MappingProcessor.mapOrRecurseObject(MappingProcessor.java:414)
at net.sf.dozer.util.mapping.MappingProcessor.mapFromFieldMap(MappingProcessor.java:309)
at net.sf.dozer.util.mapping.MappingProcessor.mapField(MappingProcessor.java:255)
at net.sf.dozer.util.mapping.MappingProcessor.map(MappingProcessor.java:224)
at net.sf.dozer.util.mapping.MappingProcessor.map(MappingProcessor.java:136)
at net.sf.dozer.util.mapping.MappingProcessor.map(MappingProcessor.java:110)
at net.sf.dozer.util.mapping.DozerBeanMapper.map(DozerBeanMapper.java:94)

Discussion

  • dmitry (lv)

    dmitry (lv) - 2008-10-12
    • assigned_to: nobody --> buzdin
     
  • dmitry (lv)

    dmitry (lv) - 2008-10-12
    • status: open --> closed
     
  • - 2008-10-13

    Why has this bug been closed without any explanation/notice..??

     
  • dmitry (lv)

    dmitry (lv) - 2008-10-13

    Sorry, the comment was unintentionally lost. Bug is reproduced and fixed. Fix will be included in the next release.

    Thank you for the bug report!

     
  • dmitry (lv)

    dmitry (lv) - 2008-10-30
    • milestone: --> Dozer v.4.3
    • status: closed --> 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