sultan commented on code in PR #845:
URL: https://github.com/apache/maven/pull/845#discussion_r1021509233
##########
maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java:
##########
@@ -404,27 +421,31 @@ public int getType()
@Override
public boolean isNull()
{
- return ( comparableQualifier( value ).compareTo(
RELEASE_VERSION_INDEX ) == 0 );
+ return QUALIFIERS.indexOf( value ) == RELEASE_VERSION_INDEX;
}
/**
- * Returns a comparable value for a qualifier.
- *
- * This method takes into account the ordering of known qualifiers
then unknown qualifiers with lexical
- * ordering.
+ * Compare the qualifiers of two artifact versions.
*
- * just returning an Integer with the index here is faster, but
requires a lot of if/then/else to check for -1
- * or QUALIFIERS.size and then resort to lexical ordering. Most
comparisons are decided by the first character,
- * so this is still fast. If more characters are needed then it
requires a lexical sort anyway.
- *
- * @param qualifier
- * @return an equivalent value that can be used with lexical comparison
+ * @param qualifier1 qualifier of first artifact
+ * @param qualifier2 qualifier of second artifact
+ * @return a negative integer, zero, or a positive integer as the
first argument is less than, equal to, or
+ * greater than the second.
*/
- public static String comparableQualifier( String qualifier )
+ public static int compareQualifiers( String qualifier1, String
qualifier2 )
Review Comment:
made a non breakage by re-adding a method with same signature and feature
compatible with new method
--
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]