[ 
https://issues.apache.org/jira/browse/JENA-1503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16392952#comment-16392952
 ] 

Andy Seaborne commented on JENA-1503:
-------------------------------------

Derke - thank you for the report and fix.

Here is how to make it happen.
{noformat}
        Node n = SSE.parseNode("'-0001-02-03T04:05:06'^^xsd:dateTime");
        System.out.println(n.getLiteralValue());
{noformat}
The fix works.

The route via creating with a {{Calendar}} (i.e. {{GregorianCalendar}}) does 
not show this because the negative is lost, which is why the test 
{{TestTypeLiterals.testDateTime}} appears to pass.  There again, 
{{GregorianCalendar}} has a year zero and the ISO calendar does not. 


> Bug in XSDDateTime toString
> ---------------------------
>
>                 Key: JENA-1503
>                 URL: https://issues.apache.org/jira/browse/JENA-1503
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Datatypes
>            Reporter: Derek Law
>            Priority: Major
>              Labels: beginner, easyfix, newbie, patch
>         Attachments: proposed_fix.txt
>
>   Original Estimate: 0.1h
>  Remaining Estimate: 0.1h
>
> toString() for the class org.apache.jena.datatypes.xsd.XSDDateTime generates 
> incorrect output when year value is between -999 and -1.
> For example : the representation of date time "-0001-01-01T00:00:00" in 
> XSDDateTime class has data array of (-1,1,1,0,0,0,0,0,0) and mask = 15. 
> however, the toString() method incorrectly outputs "000-1-01-01T00:00:00"
> proposed fix attached.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to