RFR: 8343019: Primitive caches must use boxed instances from the archive [v4]
Aleksey Shipilev
shade at openjdk.org
Wed Oct 30 10:07:22 UTC 2024
On Tue, 29 Oct 2024 12:55:32 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/Byte.java line 128:
>>
>>> 126: }
>>> 127: archivedCache = c;
>>> 128: } else if (archivedCache.length != size) {
>>
>> The `else` case for the non-int boxed type should never happen. Add `assert archivedCache.length == size;` in the if case instead?
>
> Yes, it should never happen. I wanted to have a clean failure if it _does happen_, without relying on system assertions being enabled.
Anyway, I agree that asserts should probably capture this better. We would capture this bug with `-esa` testing.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21737#discussion_r1822269271
More information about the core-libs-dev
mailing list