[ I moved this discussion to lucene-dev. -drc ] This looks like a premature optimization gone bad.
Brian, you made this change. Would you like to fix it, or should I? Doug Chris D wrote:
I found that the current code in CVS prevents a org.apache.lucene.search.DateFilter from functioning properly.
This fragment is taken from org.apache.lucene.document.DateField
// Pad with leading zeros
if (s.length() < DATE_LEN) {
StringBuffer sb = new StringBuffer(s);
while (sb.length() < DATE_LEN)
sb.insert(0, ' ');
s = sb.toString();
}
The code is padding ' ' (space) instead of zeros.
Line 5 should be: sb.insert(0, '0');
Making this change and recompiling gave the expected results.
Looking back, the lucene-1.2 source uses the following fragment:
while (s.length() < DATE_LEN)
s = "0" + s; // pad with leading zeros
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
