[ https://issues.apache.org/jira/browse/MNG-6420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17006471#comment-17006471 ]
Elliotte Rusty Harold commented on MNG-6420: -------------------------------------------- I neither agree nor disagree that "2.0" < "2.0.q" < "2.0.0.q" is non-sensical, and should be changed to "2.0" < "2.0.0.q" < "2.0.q". I'm not sure I completely understand the current spec or reasoning behind it. I do suspect (70% certainty) that we should treat "2.0.q" as equivalent to "2.0.0.q". I also think that 2.0 != 2.0.q but I'm not sure which is greater than the other. On immutable collections I find that objects that objects typed only as java.util.List cause me far more problems by being immutable than by being mutable. That is, in my career I have personally spent many more hours tracking down bugs caused by passing an immutable list to something that tried to mutate it than tracking down bugs caused by mutating a list that shouldn't have been mutated. Objects typed as ImmutableList are less troublesome but not worth introducing Guava for. > ComparableVersion incorrectly parses certain version strings > ------------------------------------------------------------ > > Key: MNG-6420 > URL: https://issues.apache.org/jira/browse/MNG-6420 > Project: Maven > Issue Type: Bug > Components: core > Affects Versions: 3.5.3 > Reporter: Ross Goldberg > Priority: Major > > For certain version strings, ComparableVersion doesn't follow the Maven > version order spec > (https://maven.apache.org/pom.html#Version_Order_Specification). > To improve the code & fix the following bugs, I completely rewrote the > version parser (using Java 10 & Google Guava 25.1). It is attached & passes > all of the tests from ComparableVersionTest. > Bug 1: > > java -jar /usr/local/Cellar/maven/3.5.3/libexec/lib/maven-artifact-3.5.3.jar > 1-0.3 1 > > Outputs: > > 1. 1-0.3 == 1-0.3 > 1-0.3 == 1 > 2. 1 == 1 > > This probleem stems from: > > [https://github.com/apache/maven/blob/b8c06e61ab73cd9e25a5b2c93d9e5077b2196751/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java#L295-L296] > > > > Bug 2: > > java -jar /usr/local/Cellar/maven/3.5.3/libexec/lib/maven-artifact-3.5.3.jar > 1-0-2 1-0.1 > > 1. 1-0-2 == 1-2 > 1-0-2 < 1-0.1 > 2. 1-0.1 == 1-0.1 > > This problem stems from retaining ListItems that, after normalization, have > no children other than the subsequent ListItem. Removing the unnecessary > ListItem should fix this (i.e. remove the extraneous ListItem (named > extraneous) from its parent ListItem (named parent), then add the only child > of extraneous to parent). -- This message was sent by Atlassian Jira (v8.3.4#803005)