atos1990 / orika

Automatically exported from code.google.com/p/orika
0 stars 0 forks source link

NPE thrown when mapping null list property on source to destination #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Mapping from source entity with null list to destination

What is the expected output? What do you see instead?
no error should be thrown; instead, NPE occurs

Please use labels and text to provide additional information.
Example generated code shown below: (the NP check needs to come before calling 
setList using the size()
{{{
if (((java.util.List) destination.getList()) == null)
   destination.setList(((java.util.List) new  java.util.ArrayList(((java.util.List) source.getList()).size())));
if (((java.util.List) source.getAmenities()) != null) {
...
}}}

Original issue reported on code.google.com by matt.deb...@gmail.com on 8 Oct 2012 at 6:36

GoogleCodeExporter commented 9 years ago
Fixed in current trunk

Original comment by matt.deb...@gmail.com on 8 Oct 2012 at 9:18