vadbch / orika

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

Convert Wrapper Double to primitive float give exception #160

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Having 2 classes
public class Person {
  private Double age;
...
}

public class PersonDto {

    private float age;
...
}

Trying to map them:
mapperFactory.classMap(Person.class, PersonDto.class)
                         .fieldAToB("age", "age")
                      .byDefault()
                     .register();

person.setAge(24.2d);

What is the expected output? What do you see instead?
Value converted : 24.2 in PersonDto age field.

I'am having an error instead:
Caused by: java.lang.NumberFormatException: For input string: "false"
see attachment.

What version of the product are you using? On what operating system?
1.4.5, windows 7.

Please provide any additional information below.
It seems to happen in ConstructorConverter. This converter can handle converion 
only if source type and dest type are both wrapper or primite, but no mix 
between wrapper and primitive.

Original issue reported on code.google.com by didos...@gmail.com on 6 May 2014 at 2:57

Attachments: