yifan-c commented on a change in pull request #892:
URL: https://github.com/apache/cassandra/pull/892#discussion_r577042093



##########
File path: src/java/org/apache/cassandra/utils/CassandraVersion.java
##########
@@ -200,6 +200,11 @@ private static Integer tryParseInt(String str)
         }
     }
 
+    public boolean isLowerThan(int major, int minor)

Review comment:
       A 4.0 lower bound version constant can be defined, just as the one 
defined in `SystemKeyspace#CURRENT_VERSION`. The earliest canonical 4.0 version 
is `4.0-alpha1`, which can be used as the lower bound. 
   
   ```java
           v1 = new CassandraVersion("4.0-alpha1");
           v2 = new CassandraVersion("4.0.0-snapshot");
           v3 = new CassandraVersion("4.0.0");
           assertTrue(v1.compareTo(v2) < 0);
           assertTrue(v1.compareTo(v3) < 0);
   ```
   
   I partially agree that `isLowerThan` could be useful. But it can provide 
conflicting results with the example you are putting, hence confusing.
   
   ```java
           // using the vars defined above.
           assertNotEquals(v1.isLowerThan(4, 0), v1.compareTo(v3) < 0);
   ```




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to