Commits


Dongjoon Hyun authored and GitHub committed bea7a34e267
GH-35053: [Java] Fix MemoryUtil to support Java 21 (#36370) ### Rationale for this change Java 21 switched `DirectByteBuffer(long,int)` constructor to `DirectByteBuffer(long,long)` via https://github.com/openjdk/jdk/commit/a56598f5a534cc9223367e7faa8433ea38661db9 ### What changes are included in this PR? In order to avoid `NoSuchMethodException` error in Java 21 environment, this PR aims to choose one of constructors based on the Java version like https://github.com/netty/netty/pull/13366 . ### Are these changes tested? ``` $ java -version openjdk version "21-ea" 2023-09-19 OpenJDK Runtime Environment (build 21-ea+28-2377) OpenJDK 64-Bit Server VM (build 21-ea+28-2377, mixed mode, sharing) $ cd java $ mvn clean package --am --pl memory/memory-core ... [INFO] Apache Arrow Java Root POM ......................... SUCCESS [ 5.693 s] [INFO] Arrow Memory ....................................... SUCCESS [ 1.703 s] [INFO] Arrow Memory - Core ................................ SUCCESS [ 7.050 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 14.630 s [INFO] Finished at: 2023-06-28T20:43:29-07:00 [INFO] ------------------------------------------------------------------------ ``` ### Are there any user-facing changes? * Closes: #35053 Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: David Li <li.davidm96@gmail.com>