martin-g commented on a change in pull request #410:
URL: https://github.com/apache/curator/pull/410#discussion_r815707779



##########
File path: 
curator-framework/src/main/java/org/apache/curator/framework/imps/GzipCompressionProvider.java
##########
@@ -45,6 +45,23 @@
     /** GZIP header magic number. */
     private static final int GZIP_MAGIC = 0x8b1f;
 
+    private static final String JAVA_VERSION_STR = 
System.getProperty("java.version", "-1");
+    private static final int JAVA_VERSION;
+    static {
+        if ("1.8".equals(JAVA_VERSION_STR)) {
+            JAVA_VERSION = 8;
+        } else if (JAVA_VERSION_STR.contains("-")) {
+            // e.g. 18-ea, take 18
+            JAVA_VERSION = Integer.parseInt(JAVA_VERSION_STR.split("-", 2)[0]);
+        } else if (JAVA_VERSION_STR.contains(".")) {
+            // e.g. 17.0.1, take 17
+            JAVA_VERSION = Integer.parseInt(JAVA_VERSION_STR.split("\\.", 
2)[0]);
+        } else {
+            JAVA_VERSION = Integer.parseInt(JAVA_VERSION_STR, 10);
+        }
+    }
+    private static final byte OS_BIT = JAVA_VERSION >= 16 ? (byte) -1 : 0;

Review comment:
       I just reverse engineered it.
   I don't know what exactly has changed in JDK 16 that caused the breakage 
here.
   This is the reason I said `I'd recommend a deeper look here!`. Someone who 
knows this code better may have better idea what is going on.




-- 
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: [email protected]

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


Reply via email to