Share

Dozer

Tracker: Bugs

5 NullPointerException in mapMap (mapping a map) - ID: 1884714
Last Update: Settings changed ( buzdin )

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(MappingProces
sor.java:367)
at
net.sf.dozer.util.mapping.MappingProcessor.mapFromFieldMap(MappingProcessor
.java:309)
at
net.sf.dozer.util.mapping.MappingProcessor.mapField(MappingProcessor.java:2
55)
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(MappingProces
sor.java:414)
at
net.sf.dozer.util.mapping.MappingProcessor.mapFromFieldMap(MappingProcessor
.java:309)
at
net.sf.dozer.util.mapping.MappingProcessor.mapField(MappingProcessor.java:2
55)
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)


Kurt Westerfeld ( kurtwesterfeld ) - 2008-02-01 17:45

5

Closed

Fixed

dmitry (lv)

None

Dozer v.4.3

Public


Comments ( 2 )

Date: 2008-10-13 15:25
Sender: buzdinProject Admin

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!


Date: 2008-10-13 14:04
Sender: maxxyme

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


Attached File

No Files Currently Attached

Changes ( 5 )

Field Old Value Date By
resolution_id None 2008-10-30 09:54 buzdin
artifact_group_id None 2008-10-30 09:54 buzdin
status_id Open 2008-10-12 20:41 buzdin
close_date - 2008-10-12 20:41 buzdin
assigned_to nobody 2008-10-12 19:39 buzdin