RFR: 8299684: (bf) JNI direct buffer functions with large capacity behave unexpectedly

Brian Burkhalter bpb at openjdk.org
Thu Jan 5 22:33:48 UTC 2023


Remove cast in `JNI::NewDirectByteBuffer`of `long` capacity to `int`, modify the constructor in question to accept a `long` capacity, and verify in the constructor that the  capacity does not overflow `int` range, throwing IAE If it does.

-------------

Commit messages:
 - 8299684: (bf) JNI direct buffer functions with large capacity behave unexpectedly

Changes: https://git.openjdk.org/jdk/pull/11873/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11873&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8299684
  Stats: 21 lines in 2 files changed: 12 ins; 3 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/11873.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11873/head:pull/11873

PR: https://git.openjdk.org/jdk/pull/11873


More information about the nio-dev mailing list