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

Eirik Bjørsnøs eirbjo at openjdk.org
Thu Feb 26 17:00:04 UTC 2026


On Wed, 28 Jan 2026 13:46:39 GMT, Eirik Bjørsnøs <eirbjo at openjdk.org> wrote:

> 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`.

Withdrawing this PR because a solution to avoid the synthetic class is better found elsewhere.

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

PR Comment: https://git.openjdk.org/jdk/pull/29466#issuecomment-3967892997


More information about the core-libs-dev mailing list