You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by us...@apache.org on 2022/07/01 16:27:19 UTC

[solr] branch branch_9x updated: Fix bug with version constant (see https://github.com/apache/lucene/pull/978)

This is an automated email from the ASF dual-hosted git repository.

uschindler pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 9450e5c0afd Fix bug with version constant (see https://github.com/apache/lucene/pull/978)
9450e5c0afd is described below

commit 9450e5c0afd4e2c3ea8f6f557937c06ab956b2d9
Author: Uwe Schindler <us...@apache.org>
AuthorDate: Fri Jul 1 17:04:20 2022 +0200

    Fix bug with version constant (see https://github.com/apache/lucene/pull/978)
---
 .../apache/solr/client/solrj/util/Constants.java   | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/util/Constants.java b/solr/solrj/src/java/org/apache/solr/client/solrj/util/Constants.java
index ee5307c48f6..3ad41799b59 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/util/Constants.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/util/Constants.java
@@ -17,26 +17,12 @@
 
 package org.apache.solr.client.solrj.util;
 
-import java.util.StringTokenizer;
-
 // Clone of org.apache.lucene.util.Constants, so SolrJ can use it
 public class Constants {
   public static final String JVM_SPEC_VERSION = System.getProperty("java.specification.version");
-  private static final int JVM_MAJOR_VERSION;
-  private static final int JVM_MINOR_VERSION;
-
-  static {
-    final StringTokenizer st = new StringTokenizer(JVM_SPEC_VERSION, ".");
-    JVM_MAJOR_VERSION = Integer.parseInt(st.nextToken());
-    if (st.hasMoreTokens()) {
-      JVM_MINOR_VERSION = Integer.parseInt(st.nextToken());
-    } else {
-      JVM_MINOR_VERSION = 0;
-    }
-  }
 
-  public static final boolean JRE_IS_MINIMUM_JAVA9 =
-      JVM_MAJOR_VERSION > 1 || (JVM_MAJOR_VERSION == 1 && JVM_MINOR_VERSION >= 9);
-  public static final boolean JRE_IS_MINIMUM_JAVA11 =
-      JVM_MAJOR_VERSION > 1 || (JVM_MAJOR_VERSION == 1 && JVM_MINOR_VERSION >= 11);
+  public static final boolean JRE_IS_MINIMUM_JAVA9 = true;
+  public static final boolean JRE_IS_MINIMUM_JAVA11 = true;
+  // Future, enable if needed...
+  // public static final boolean JRE_IS_MINIMUM_JAVA17 = Runtime.version().feature() >= 17;
 }