#218 Cannot convert directly from Date <-> Calendar

Dozer v5.2
closed-fixed
nobody
5
2009-10-14
2009-09-09
Marty Pitt
No

The following test fails:

@Test
public void testConversion()
{
GregorianCalendar cal = new GregorianCalendar(2009, 2, 3);
Date sourceValue = cal.getTime();
DozerBeanMapper mapper = new DozerBeanMapper();
Object result = mapper.map(sourceValue, Calendar.class);
}

Discussion

  • dmitry (lv)

    dmitry (lv) - 2009-10-14

    Workaround is to use create-method in Xml

    <mapping>
    <class-a>java.util.Date</class-a>
    <class-b create-method="getInstance">java.util.Calendar</class-b>
    </mapping>

     
  • dmitry (lv)

    dmitry (lv) - 2009-10-14

    Fixed in trunk. Will be shipped in 5.2.
    Thanks for the report!

     
  • dmitry (lv)

    dmitry (lv) - 2009-10-14
    • milestone: --> Dozer v5.2
    • status: open --> closed-fixed
     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks