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

Michael McCandless updated LUCENE-5952:
---------------------------------------
    Attachment: LUCENE-5952.patch

Here's the patch to port the fix to 5.x.

The only change vs 4.10.x is that I changed 
Lucene46SegmentInfoFormat/Writer/Reader to explicitly encode the 4 ints in 
Version, instead of relying on String parsing at read time.  I added 
Version.write/Version.read static methods for this, though it makes me somewhat 
nervous having them there outside of the scope of a "format"... I put a NOTE 
that this format can never be changed.

> Give Version parsing exceptions more descriptive error messages
> ---------------------------------------------------------------
>
>                 Key: LUCENE-5952
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5952
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: 4.10
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Blocker
>             Fix For: 4.10.1, 5.0, 6.0
>
>         Attachments: LUCENE-5952.patch, LUCENE-5952.patch, LUCENE-5952.patch, 
> LUCENE-5952.patch, LUCENE-5952.patch, LUCENE-5952.patch
>
>
> As discussed on the dev list, it's spooky how Version.java tries to fully 
> parse the incoming version string ... and then throw exceptions that lack 
> details about what invalid value it received, which file contained the 
> invalid value, etc.
> It also seems too low level to be checking versions (e.g. is not future proof 
> for when 4.10 is passed a 5.x index by accident), and seems redundant with 
> the codec headers we already have for checking versions?
> Should we just go back to lenient parsing?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to