Bug in 
org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl.UtilDateTypeConverterImpl
-----------------------------------------------------------------------------------------------------

         Key: GRFT-72
         URL: http://issues.apache.org/jira/browse/GRFT-72
     Project: Graffito
        Type: Bug
  Components: JCR-Mapping  
    Reporter: Martin Koci


In this converter following line is used:
return this.getValueFactory().createValue(((java.util.Date) 
propValue).getTime());
but propValue must be converted to java.util.Calendar, not into long! 
ValueFactory than converts to LongValue not DateValue as expected.

Following code works OK:
final long timeInMilis = ((java.util.Date) propValue).getTime();
final Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(timeInMilis);
return this.getValueFactory().createValue( calendar );

but I dont know better Date-> Calendar conversion.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to