#255 DozerConverter fails on primitive to primitive map

Dozer v5.2.2
closed-fixed
nobody
5
2010-05-12
2010-04-21
ryan eberly
No

In latest release (5.2), DozerConverter cannot perform a mapping involving a primitive value.

Bug 2919389 - resulted in a change that allows primitive to Object mapping to work, but primitive to primitive mapping still fails.

This is because int.class is not treated the same as Integer.class in org.dozer.DozerConverter.convert(Object, Object, Class<?>, Class<?>)

I'm attaching a patch to the test case demonstrating the problem. and a possible solution (if both destination and source classes are primitive, replace one of them with it's associated wrapper class before decided whether this is a covertFrom() or a convertTo())

Discussion

  • ryan eberly

    ryan eberly - 2010-04-21

    proposed solution patch

     
  • ryan eberly

    ryan eberly - 2010-04-21

    patch to test case demonstrating problem.

     
  • dmitry (lv)

    dmitry (lv) - 2010-05-12

    I think the files attached are from the original bugfix, not from your proposal

     
  • dmitry (lv)

    dmitry (lv) - 2010-05-12
    • milestone: 1049123 --> Dozer v5.2.2
    • status: open --> closed-fixed
     
  • dmitry (lv)

    dmitry (lv) - 2010-05-12

    Fixed by calling ClassUtils.primitiveToWrapper at start of each convertation

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks