You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Kelvin Goodson (JIRA)" <tu...@ws.apache.org> on 2007/02/27 11:44:05 UTC

[jira] Resolved: (TUSCANY-1044) DataHelperImpl.toDateTime() is not compliant with spec.

     [ https://issues.apache.org/jira/browse/TUSCANY-1044?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kelvin Goodson resolved TUSCANY-1044.
-------------------------------------

    Resolution: Fixed

TUSCANY-1044 DataHelperImpl.toDateTime now uses canonical time zone suffix "Z"

> DataHelperImpl.toDateTime() is not compliant with spec.
> -------------------------------------------------------
>
>                 Key: TUSCANY-1044
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1044
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Implementation
>    Affects Versions: Java-SDO-Mx
>            Reporter: Ron Gavlin
>             Fix For: Java-SDO-Mx
>
>         Attachments: DateTime.patch, DateTimeTest.zip
>
>
> Ron,
>    I think you are correct.  The spec says ...
> The String representation of DateTime, Duration, Time, Day, Month, MonthDay,
> Year, YearMonth, and YearMonthDay follows the lexical representation defined
> in XML Schema for the corresponding data types: dateTime, duration, time,
> gDay, gMonth, gMonthDay, gYear, gYearMonth, and Date respectively.
> and the XML schema definition at
> http://www.w3.org/TR/xmlschema-2/#dateTime-timezones seems to be overriden
> by the errata at http://www.w3.org/2001/05/xmlschema-errata#e2-45 which
> gives ...
> The lexical representation of a timezone is a string of the form: (('+' |
> '-') hh ':' mm) | 'Z', where *hh* is a two-digit numeral (with leading zeros
> as required) that represents the hours, *mm* is a two-digit numeral that
> represents the minutes, '+' indicates a nonnegative duration, and '-'
> indicates a nonpositive duration. The mapping so defined is one-to-one,
> except that '+00:00', '00:00', and 'Z' all represent the same zero-length
> duration timezone, UTC; 'Z' is its canonical representation.
>   so please raise a JIRA, and of course I have to say it ... a fix would be
> great too ;-)
> Cheers, Kelvin.
> On 09/01/07, Ron Gavlin <rg...@yahoo.com> wrote:
> >
> > Greetings,
> >
> > Based on my reading of the spec, DataHelperImpl.toDateTime(Calendar)
> > should return a String compatible with the XML Schema dateTime. Consider the
> > code snippet below:
> >
> > import commonj.sdo.helper.DataHelper;
> >
> > System.out.println(DataHelper.INSTANCE.toDateTime(
> > DataHelper.INSTANCE.toCalendar("2007-01-01T00:00:00.200Z"))
> >
> > This snippet prints the result:
> > (java.lang.String) 2007-01-01T00:00:00.200 GMT
> >
> > instead of
> > (java.lang.String) 2007-01-01T00:00:00.200Z
> >
> > The GMT suffix seems incorrect to me. The following code supports this
> > assertion by throwing an IllegalArgumentException when it encounters the "
> > GMT" suffix generated by the DataHelper.toDateTime() method.
> >
> > import javax.xml.datatype.DatatypeFactory;
> >
> > DatatypeFactory.newInstance().newXMLGregorianCalendar("2007-01-01T00:00:
> > 00.200 GMT");
> >
> > Do you agree this is a bug? If so, I'll be glad to open a JIRA.
> >
> > - Ron

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org