stoerr commented on code in PR #260:
URL: 
https://github.com/apache/jackrabbit-filevault/pull/260#discussion_r1052226353


##########
vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/Version.java:
##########
@@ -135,44 +136,40 @@ public String[] getNormalizedSegments() {
     }
 
     /**
-     * Compares this version to the given one, segment by segment without any 
special
-     * "SNAPSHOT" handling.
+     * Compares this version to the given one. The comparison is compatible to 
the ordering used by
+     * <a href="https://maven.apache.org/";>Apache Maven</a>. It version 
consists normally from 3 numbers -
+     * major version, minor version and patch level, and can be followed by a 
dash and a qualifier like SNAPSHOT.
+     * Version numbers can also consist of fewer or more numbers.
+     * If the comparison is not resolved by comparing the numbers, the 
algorith resorts to the qualifier - see
+     * <a 
href="https://cwiki.apache.org/confluence/display/MAVENOLD/Versioning";>"Versioning"
 on Maven Wiki</a>
+     * for details.
      *
      * <pre>
-     * Examples:
+     * Some examples:
      * "1" &lt; "2"
      * "1.0" &lt; "2"
      * "2.0.1" &lt; "2.1"
      * "2.1" &lt; "2.1.1"
      * "2.9" &lt; "2.11"
-     * "2.1" &lt; "2.1-SNAPSHOT"
-     * "2.1" &lt; "2.1-R1234556"
-     * "2.1-R12345" &lt; "2.1-SNAPSHOT"
+     * "2.1-SNAPSHOT" &lt; "2.1"
+     * "2.1-RC1" &lt; "2.1"
+     * "2.1-RC1" &lt; "2.1-SNAPSHOT"
      * </pre>
      *
-     * @param o the other version
+     * Please note that this comparison does not use the exact segmentation 
presented in {@link #getNormalizedSegments()},
+     * but applies the maven comparison algorithm to the string representation 
{@link #toString()}.
+     *
+     * @param o the other version, not null
      * @return  a negative integer, zero, or a positive integer as this version
      *         is less than, equal to, or greater than the specified version.
+     *
+     * @see "https://cwiki.apache.org/confluence/display/MAVENOLD/Versioning";

Review Comment:
   Ah, thanks! I've been doing that wrong for ages. 8-}



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to