Integrated: 8208752: Calling a deserialized Lambda might fail with ClassCastException

Liam Miller-Cushon cushon at openjdk.org
Tue Feb 10 09:12:45 UTC 2026


On Sun, 21 Dec 2025 14:02:55 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:

> See [JDK-8208752: Calling a deserialized Lambda might fail with ClassCastException](https://bugs.openjdk.org/browse/JDK-8208752).
> 
> Lambda deserialization currently does not consider `SerializedLambda#getInstantiatedMethodType` when deserializing lambdas, which can lead to method references that differ only in `getInstantiatedMethodType` being merged into the same lambda instance, and can result in `ClassCastException`s like the one reported in the bug.
> 
> This depends on the fix for [JDK-8374654: Inconsistent handling of lambda deserialization for Object method references on interfaces](https://bugs.openjdk.org/browse/JDK-8374654) in https://github.com/openjdk/jdk/pull/29075.

This pull request has now been integrated.

Changeset: 665dc490
Author:    Liam Miller-Cushon <cushon at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/665dc490c2a1bcaa1fa1cf6f0ea2396ce4b31863
Stats:     188 lines in 8 files changed: 163 ins; 0 del; 25 mod

8208752: Calling a deserialized Lambda might fail with ClassCastException
8374654: Inconsistent handling of lambda deserialization for Object method references on interfaces

Reviewed-by: vromero, jlahoda

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

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


More information about the core-libs-dev mailing list