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

Ryan Ernst updated LUCENE-5850:
-------------------------------

    Attachment: LUCENE-5850.patch

This patch consolidates LUCENE_MAIN_VERSION and associated parsing/comparison 
code into Version.java.  Specifically, it:
* Deprecates {{Constants.LUCENE_MAIN_VERSION}} and {{Constants.LUCENE_VERSION}}
* Makes {{Version}} a class instead of an enum.  This allows forward 
compatibility when parsing (e.g. 4.10.0 being able to read a 3.6.5 index that 
is as yet unreleased)
* Adds constants for specific releases (e.g. {{LUCENE_4_10_0}}) and deprecates 
older minor release constants (e.g. {{LUCENE_4_9}})
* Renames {{LUCENE_CURRENT}} constant  (but with deprecation for backcompat)  
to {{LATEST}}, and removes deprecation.  This now is a true alias for the 
latest version, and having latest deprecated, but not the actual latest version 
deprecated, was confusing.
* Changes all uses of {{StringHelper.getVersionComparator()}} to use 
{{Version.onOrAfter}}
* Makes {{SegmentInfo}} take a {{Version}}, instead of string
* Removes the "display" version (replaced with toString() of the latest 
version).  This didn't seem useful as it doesn't contain any interesting 
information, and would only contain extra information if built with svn (AFAICT)
* Adds {{Version.parse()}} which only parses dot based versions.  In general, I 
think everything should use this function and we should deprecate 
parseLeniently, but I've left the latter for now.
* Removes snapshot logic as far as the version is concerned in code (it was 
only used for the display version)

I've probably forgot some things.  All tests pass.

> Constants#LUCENE_MAIN_VERSION can have broken values 
> -----------------------------------------------------
>
>                 Key: LUCENE-5850
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5850
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: general/build
>    Affects Versions: 4.3.1, 4.5.1
>            Reporter: Simon Willnauer
>             Fix For: 5.0, 4.10
>
>         Attachments: LUCENE-5850.patch, LUCENE-5850.patch, LUCENE-5850.patch, 
> LUCENE-5850.patch, LUCENE-5850.patch, LUCENE-5850.patch, LUCENE-5850.patch, 
> LUCENE-5850_bomb.patch, LUCENE-5850_smoketester.patch
>
>
> Constants#LUCENE_MAIN_VERSION is set to the Lucene Main version and should 
> not contain minor versions. Well this is at least what I thought and to my 
> knowledge what the comments say too. Yet in for instance 4.3.1 and 4.5.1 we 
> broke this such that the version from SegmentsInfo can not be parsed with 
> Version#parseLeniently. IMO we should really add an assertion that this 
> constant doesn't throw an error and / or make the smoketester catch this. to 
> me this is actually a index BWC break. Note that 4.8.1 doesn't have this 
> problem...



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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

Reply via email to