lidavidm commented on code in PR #1008:
URL: https://github.com/apache/arrow-java/pull/1008#discussion_r2825248567


##########
memory/memory-core/src/main/java/org/apache/arrow/memory/util/MemoryUtil.java:
##########
@@ -81,9 +82,18 @@ public Object run() {
       BYTE_ARRAY_BASE_OFFSET = UNSAFE.arrayBaseOffset(byte[].class);
 
       // get the offset of the address field in a java.nio.Buffer object
+      long maybeOffset;
       Field addressField = java.nio.Buffer.class.getDeclaredField("address");
-      addressField.setAccessible(true);
-      BYTE_BUFFER_ADDRESS_OFFSET = UNSAFE.objectFieldOffset(addressField);
+      try {
+        addressField.setAccessible(true);
+        maybeOffset = UNSAFE.objectFieldOffset(addressField);
+      } catch (InaccessibleObjectException e) {
+        maybeOffset = -1;

Review Comment:
   I guess my question is, what is the value of deferring the exception until 
later? I'm not sure you can do much with arrow-java if this isn't available.



-- 
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