lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <>
Subject [jira] [Updated] (SOLR-1899) dates prior to 1000AD are not formatted properly in responses
Date Tue, 03 May 2011 02:01:04 GMT


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:
>             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:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message