Alternative Version implementation
David M. Lloyd
david.lloyd at redhat.com
Wed Mar 23 22:29:48 UTC 2016
On 03/23/2016 01:46 PM, David M. Lloyd wrote:
> On 03/23/2016 09:20 AM, David M. Lloyd wrote:
>> I've gone ahead and written a new Version implementation that implements
>> the rules I've described. It seems to work OK though I am having a hard
>> time running all tests locally due to some environmental problem that
>> I'm still working on, so I don't have a webrev yet. But I do have a
>> diff that can be examined (and commented upon) at [1].
>
> One oddity that springs up relating to numeric versions when not
> normalizing the version string in any way is that version segments
> leading zeros parse and sort strangely. After fiddling around with
> various approaches, currently I've settled on this order:
After some discussion with Paul Benedict and Neil Bartlett, I've updated
the comparator code to sort as follows:
1
1.0
1.00
1.000
1.1
1.01
1.001
1.10
1.010
1.11
1.011
1.100
1.101
1.110
1.111
The numeric value is most significant, and the length (shortest to
longest) is least significant.
--
- DML
More information about the jpms-spec-experts
mailing list