-
Bug
-
Resolution: Fixed
-
P4
-
9, 10, 10.0.1, 11
-
b19
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8205794 | 11.0.1 | Bernard Blaser | P4 | Resolved | Fixed | team |
A DESCRIPTION OF THE PROBLEM :
In this example a lambda Comparable (so with return type int) returns a Character. This should cause unboxing and then conversion to int. But javac generates code that instead tries to convert the Character to Integer before the unboxing, leading to an unexpected ClassCastException
---------- BEGIN SOURCE ----------
List.of('x', 'y').stream()
.max((a, b) -> {return List.of(a).get(0);});
---------- END SOURCE ----------
FREQUENCY : always
In this example a lambda Comparable (so with return type int) returns a Character. This should cause unboxing and then conversion to int. But javac generates code that instead tries to convert the Character to Integer before the unboxing, leading to an unexpected ClassCastException
---------- BEGIN SOURCE ----------
List.of('x', 'y').stream()
.max((a, b) -> {return List.of(a).get(0);});
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8205794 Unboxing in return from lambda miscompiled to throw ClassCastException
-
- Resolved
-
- relates to
-
JDK-8205189 5.2: Fix heap pollution checks
-
- Open
-
-
JDK-8221373 Missing checkcast in void-returning lambda
-
- Closed
-