vadbch / orika

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

NullPointerException while generating mapper for Map type #155

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Create two classes that have java.util.Map property - to make it simple 
create the same names of this specific property to tell Orika that it should 
map it 1-1. (any Map generic type, for example <String, String> is ok)
2.Create filter which extends CustomFilter that will apply in that case (to 
make sure it applies on that mapping I created TestFilter extends 
CustomFilter<Object, Object>)
3.Register filter by MapperFactory
4.Execute mapperFactory.getMapperFacade().map(source, destination.getClass()); 
on defined types with maps

What is the expected output? What do you see instead?
Expected: generated mapper and working mapping because it is straightforward

Instead: while generating mapper code it is creating filter list which apply to 
this particular mapping. When invoking appliesTo method on filter for a Map 
property it is ok, but then it is invoking appliestTo method on Map KEY ant it 
throws NullPointerExceptione - because destination paramether in appliesTo 
method is NULL.
I have attached stack trace

What version of the product are you using? On what operating system?
Orika 1.4.6-SNAPSHOT

Please provide any additional information below.

Original issue reported on code.google.com by diegomar...@gmail.com on 4 Apr 2014 at 11:01

Attachments: