mocobeta commented on code in PR #941:
URL: https://github.com/apache/lucene/pull/941#discussion_r887625886


##########
buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java:
##########
@@ -55,9 +64,18 @@ public static void main(String[] args) {
   }
 
   public static void checkVersion() {
-    int major = Runtime.getRuntime().version().feature();
-    if (major != 17) {
-      throw new IllegalStateException("java version be exactly 17, your 
version: " + major);
+    Runtime.Version version = Runtime.version();
+    int feature = version.feature();
+    int interim = version.interim();
+    int update = version.update();
+    // Version.toString() can return arbitrary version string depending on 
vendors.
+    // Reformat as "$FEATURE.$INTERIM.$UPDATE"
+    final String runtimeVersionString = String.format("%d.%d.%d", feature, 
interim, update);

Review Comment:
   Ok, the version format spec (regex) says minor/patch versions are optional.
   
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Runtime.Version.html



-- 
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...@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to