CrazyHZM commented on code in PR #1099:
URL: https://github.com/apache/maven/pull/1099#discussion_r1230381847


##########
maven-artifact/src/test/java/org/apache/maven/artifact/versioning/ComparableVersionTest.java:
##########
@@ -147,10 +154,10 @@ void testVersionsEqual() {
         checkVersionsEqual("1.0.0x", "1-x");
 
         // aliases
-        checkVersionsEqual("1ga", "1");
-        checkVersionsEqual("1release", "1");
-        checkVersionsEqual("1final", "1");
-        checkVersionsEqual("1cr", "1rc");
+        checkVersionsEqualOrder("1ga", "1");

Review Comment:
   This code change will cause checkVersionsEqual("1ga", "1") to fail, and I 
think you can take a closer look at the specific changes.
   The difference between `checkVersionsEqualOrder` and the 
`checkVersionsEqual` method is that `checkVersionsEqualOrder` only compares the 
order of versions, `checkVersionsEqual` compares Comparable HashCodes.
   As for why I changed this test, I think I have explained above, because the 
previous logic was to directly change the contents of `1ga` to `1`, but now I 
will let `1ga` still stand for `1ga`, which will cause the hashcode in 
`checkVersionsEqual` to fail. This requires a new `checkVersionsEqualOrder` 
method to test that the order between `1ga` and `1` is consistent.
   



-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to