Apache9 commented on a change in pull request #3784:
URL: https://github.com/apache/hbase/pull/3784#discussion_r736575423



##########
File path: hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java
##########
@@ -60,6 +60,21 @@
 
   private static final String JVMVersion = System.getProperty("java.version");
 
+  /**
+   * The raw String of java specification version.
+   * "1.8" for java8, "9","10"... for Java 9, 10...
+   */
+  private static final String JVM_SPEC_VERSION_STRING =
+    System.getProperty("java.specification.version");
+
+  /**
+   * The Integer represent of JVM_SPEC_VERSION, for the JVM version comparison.
+   * NOTE: Java 8 will be represented by 1.
+   */
+  private static final int JVM_SPEC_VERSION = 
JVM_SPEC_VERSION_STRING.contains(".") ?
+    (int) Float.parseFloat(System.getProperty("java.specification.version")) :

Review comment:
       Why not just use the above JVM_SPEC_VERSION_STRING? And let's use 
substring and then parse 1.8 to 8? Or use float and multiply 10 and then minus 
10 to get 8? It is a bit strange that we return 1 for 1.8...

##########
File path: hbase-common/src/main/java/org/apache/hadoop/hbase/util/JVM.java
##########
@@ -106,6 +121,10 @@ public static boolean isGZIPOutputStreamFinishBroken() {
     return ibmvendor && JVMVersion.contains("1.6.0");
   }
 
+  public static float getJVMSpecVersion() {

Review comment:
       Should return int here?




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

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


Reply via email to