RFR: 8341594: Use Unsafe to coalesce reads in java.util.zip.ZipUtils [v2]

Eirik Bjørsnøs eirbjo at openjdk.org
Sun Oct 6 19:36:34 UTC 2024


On Sun, 6 Oct 2024 19:19:15 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> How would you model unsigned long values here, though?

I don't think we should. `9223372036854775807 ` should be enough for everyone :-)

It may be worth renaming the method to `get64S` and add a `get64` variant which either clamps at `LONG.MAX_VALUE` or throws `IllegalArgumentException` for larger values. Call sites doing custom validation (like `checkZip64ExtraFieldValues`) could then call `get64S` and check for a negative long.

But that's food for another PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21377#discussion_r1789220684


More information about the core-libs-dev mailing list