If you step through the algorithm from the spec, and if you run the main method from ComparableVersion, you’ll see that the canonical form for 1-0-2 is indeed 1-2. There are places where the code deviates from the spec, for which I’ve filed a bug report, but this is not one of them.
Does whoever is in charge of the spec intend for 1-0-2 > 1-1? If yes, then we can discuss the merits of the two different orderings, and the spec lead can decide whatever they want (that spec lead might be you, but it certainly isn’t me, so I know I don’t have any decision-making authority). If no, then the code is definitely wrong, and must be fixed. We can then look through the spec & determine if the spec needs to be revised, and, if it must, determine the best way to revise it. On Fri, Jun 1, 2018 at 6:33 PM Robert Scholte <[email protected]> wrote: > IIRC only digits between dots are interpreted as numbers and will be > compared as numbers > With dashes values are concatenated as a String and hence will be > compared > as Strings. > So dots and dashes have a different effect. > > Here you can find a huge number of tests that should cover it: > > https://maven.apache.org/resolver/maven-resolver-util/xref-test/org/eclipse/aether/util/version/GenericVersionTest.html > > Robert > > On Sat, 02 Jun 2018 00:12:57 +0200, Ross Goldberg > <[email protected]> wrote: > > > Sorry, I didn’t mean that the spec explicitly states an example that: > > > > 1-0-2 = 1-2 > 1-1 > > > > I meant that the algorithm described in the spec results in that outcome. > > ComparableVersion correctly outputs that for the comparison between > > 1-0-2 & > > 1-1. > > > > Both my original & my revised proposed change to the spec would result > > in: > > > > 1-0-2 = 1-0-2 < 1-1 > > > > Which I think makes more sense. > > > > My original proposal would have resulted in: > > > > 1-0-rc = 1-0-rc > > > > But my revised proposal results in: > > > > 1-0-rc = 1-rc > > > > Which accords with the existing spec, so my revised proposal improves > > upon > > my original proposal. > > > > Throughout this email, the syntax for = is: > > > > original = canonical > > > > On Fri, Jun 1, 2018 at 5:34 PM Robert Scholte <[email protected]> > > wrote: > > > >> On Thu, 31 May 2018 16:22:18 +0200, Ross Goldberg > >> <[email protected]> wrote: > >> > >> > The maven Maven version order spec ( > >> > https://maven.apache.org/pom.html#Version_Order_Specification) > >> indicates > >> > that : > >> > > >> > 1-0-2 is equivalent to 1-2, so 1-0-2 = 1-2 > 1-1. > >> > >> I don't recognize this. Can you quote from that page? > >> > >> Robert > >> > >> > > >> > That doesn't make much sense to me. > >> > > >> > I think the following line from the spec should be revised from: > >> > > >> > Then, starting from the end of the version, the trailing "null" values > >> > (0, > >> > "", "final", "ga") are trimmed. > >> > > >> > To: > >> > > >> > Then, starting from the end of the version string, all trailing "null" > >> > qualifier tokens ("", "final", "ga") are trimmed. All trailing > >> numeric 0 > >> > tokens that do not immediately follow a hyphen prefix (regardless of > >> > whether the hyphen is explicit or implicit) are likewise trimmed. > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [email protected] > >> For additional commands, e-mail: [email protected] > >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
