ndimiduk commented on a change in pull request #1113: HBASE-21110 Remove `Illegal reflective access` warning for `java.nio.Bits.unaligned()` URL: https://github.com/apache/hbase/pull/1113#discussion_r374414331
########## File path: hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAvailChecker.java ########## @@ -21,50 +21,64 @@ import java.lang.reflect.Method; import java.security.AccessController; import java.security.PrivilegedAction; +import sun.misc.Unsafe; import org.apache.yetus.audience.InterfaceAudience; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +@SuppressWarnings("restriction") @InterfaceAudience.Private public class UnsafeAvailChecker { + private static final Unsafe UNSAFE; Review comment: Indeed that was the old reasoning. The idea was that not all JVM implementations have an `Unsafe` class, so interfacing with it, if it existed, had to be done entirely via reflection. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services