You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2011/05/03 04:01:04 UTC

[jira] [Updated] (SOLR-1899) dates prior to 1000AD are not formatted properly in responses

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

Hoss Man updated SOLR-1899:
---------------------------

    Attachment: SOLR-1899.patch

his came up again on the mailing list today, so i started looking into it.

the previously mentioned cut/paste code has since been refactored to TestResponseWriter.

this patch eliminates it completely in place of using the existing thread safe methods in DateField (which this patch makes public/static so they can be used by other classes besides just subclasses)

this patch includes tests demonstrating that a parse+format roundtrip of years between 0001 and 1000 works fine -- but there is still a problem with negative years (something sublte in SimpleDateFormat that i don't understand yet)

While working on this, i also noticed a class i was previously unfamiliar with: o.a.s.c.u.DateUtils ... which seems to have yet another cut/paste copy of the broken date formatting code, as well as cut/paste copies of the thread save parsing/formatting code from DateField (except at first glance the DateUtils version is even more broken and doesn't deal with miliseconds properly) ... need to research WTF this is, when it was added (did we release it already?), and if anyone is calling it.

it should be trivial to make these broken DateUtil parse/format into deprecated proxies to their counterparts in DateField ... or vice versa if people think it makes more sense to have them in a separate util class (although that may complicate SOLR-2357 even further)

> dates prior to 1000AD are not formatted properly in responses
> -------------------------------------------------------------
>
>                 Key: SOLR-1899
>                 URL: https://issues.apache.org/jira/browse/SOLR-1899
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.2, 1.3, 1.4
>            Reporter: Hoss Man
>         Attachments: SOLR-1899.patch
>
>
> As noted on the mailing list, if a document is added to solr with a date field such as "0001-01-01T00:00:00Z" then when that document is returned by a search the year will be improperly formated as "1-01-01T00:00:00Z"

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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