atos1990 / orika

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

Javassist compile error for primitive type mapping when respective converter is present. #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Register mapping between primitive double and BigDecimal
2. Register bidirectional converter between Double and BigDecimal
3. Run application

What is the expected output? What do you see instead?
Mapping facade building fails with message
compile error: invalid types for !=
    at javassist.compiler.CodeGen.badTypes(CodeGen.java:1255) ...

What version of the product are you using? On what operating system?
1.1.0 on Mac OS, Weblogic 12.1.1 Java 6

Please provide any additional information below.
When the convertor is not registered, facade building succeeds. Javassist 
prints the whole failing code where the critical part is retyping double and 
comparing it with null(in my opinion. names obfuscated):

if(((double)((xxx)((yyy)((zzz)source.getRequestBody()).aaa()).bbb()).getAmount()
) != null){
                destination.setAmount((java.math.BigDecimal) mapperFacade.convert(((double)((xxx)((yyy)((zzz)source.getRequestBody()).aaa()).bbb()).getAmount()), usedTypes[4], usedTypes[3], null));

            }

Original issue reported on code.google.com by frantise...@calavera.info on 26 Apr 2012 at 5:22

GoogleCodeExporter commented 9 years ago
You're primtives should not be compared to null, and that's what we do in Orika.

Il will check this ASAP and reply you
Thanks for the issue report.

Original comment by elaat...@gmail.com on 27 Apr 2012 at 10:33

GoogleCodeExporter commented 9 years ago

Original comment by elaat...@gmail.com on 29 Apr 2012 at 8:26