brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geomacy <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #740: New versioning rules prep
Date Tue, 27 Jun 2017 16:06:13 GMT
Github user geomacy commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/740#discussion_r124290451
  
    --- Diff: utils/common/src/main/java/org/apache/brooklyn/util/text/VersionComparator.java
---
    @@ -18,27 +18,27 @@
      */
     package org.apache.brooklyn.util.text;
     
    -import java.util.ArrayList;
    -import java.util.Arrays;
    -import java.util.Collection;
     import java.util.Comparator;
    +import java.util.regex.Matcher;
    +import java.util.regex.Pattern;
     
    -import org.apache.brooklyn.util.text.NaturalOrderComparator;
    -import org.apache.brooklyn.util.text.Strings;
    -
    -import com.google.common.annotations.VisibleForTesting;
    +import com.google.common.base.Objects;
     
     /**
      * {@link Comparator} for version strings.
      * <p>
    - * SNAPSHOT items always lowest rated, 
    - * then splitting on dots,
    - * using natural order comparator (so "9" < "10" and "4u8" < "4u20"),
    - * and preferring segments without qualifiers ("4" > "4beta").
    + * This gives the desired semantics for our recommended version syntax,
    + * following <code>major.minor.patch-qualifier</code> syntax, 
    + * doing numeric order of major/minor/patch (1.10 > 1.9),
    + * treating anything with a qualifier lower than the corresponding without but higher
than items before
    + * (1.2 > 1.2-rc > 1.1),
    + * SNAPSHOT items always lowest rated (1.0 > 2-SNAPSHOT), and 
    + * qualifier sorting follows {@link NaturalOrderComparator} (1-M10 > 1-M9).
    --- End diff --
    
    See comment below.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message