RFR: 8376582: Remove assert from default method in java.util.zip.Checksum interface

Eirik Bjørsnøs eirbjo at openjdk.org
Wed Jan 28 13:55:16 UTC 2026


Please review this PR which removes an `assert` from the default method `Checksum::update(ByteBuffer)`.

Since this is an interface, javac generates a synthetic inner class to capture the `$assertionsDisabled` information.

This is the only use of assert within default methods in `java.base`.

I do not think it carries its weight in terms of the loading the generated class, so I suggest we simply remove it. The method already returns when `pos > limit`.

Trivial cleanup, `noreg-cleanup`.

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

Commit messages:
 - Remove assert in default method causing synthetic nested class to be generated

Changes: https://git.openjdk.org/jdk/pull/29466/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29466&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8376582
  Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/29466.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29466/head:pull/29466

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


More information about the core-libs-dev mailing list