You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "fapifta (via GitHub)" <gi...@apache.org> on 2024/09/01 20:48:34 UTC
Re: [PR] HDDS-11392. ChecksumByteBufferImpl's static initializer fails with java 17+ [ozone]
fapifta commented on code in PR #7135:
URL: https://github.com/apache/ozone/pull/7135#discussion_r1740191883
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/common/ChecksumByteBufferImpl.java:
##########
@@ -44,12 +44,14 @@ public class ChecksumByteBufferImpl implements ChecksumByteBuffer {
static {
Field f = null;
- try {
- f = ByteBuffer.class
- .getDeclaredField("isReadOnly");
- f.setAccessible(true);
- } catch (NoSuchFieldException e) {
- LOG.error("No isReadOnly field in ByteBuffer", e);
+ if (JavaUtils.isJavaVersionAtMost(8)) {
Review Comment:
Yes it is, however it is much more explicit about what happens, that's why I chose this way.
--
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-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org