RFR: 8374308: ImageBufferCache does not work as intended [v2]

David Beaumont duke at openjdk.org
Tue Jan 6 10:49:42 UTC 2026


On Tue, 6 Jan 2026 10:30:00 GMT, David Beaumont <duke at openjdk.org> wrote:

>> Only needs to check for the `Integer.MAX_VALUE` in any case, as `ByteBuffer::allocateDirect` throws on `size < 0`. It also uses IAE
>
> Fair points. This is just moved code, but IOOBE is clearly not the right choice here.

In fact, taking a more holistic view, the size check is already done by the caller, so there's some nice simplification possible here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29043#discussion_r2664504433


More information about the core-libs-dev mailing list