On Sun, 10 Aug 2025 01:11:43 GMT, Chen Liang <li...@openjdk.org> wrote:

> ConstantBootstraps.explicitCast behaves like a snippet of code in its 
> specification. However, in the rest of the nominal spec, it incorrectly 
> assumes a null `value` and a primitive `dstType` results in a 
> ClassCastException instead of the zero value of that primitive type. This is 
> inconsistent with that snippet and the actual code behavior.
> 
> The specification is fixed, the test for `explicitCast` is merged into the 
> main `ConstantBootstraps` test, and a new unit test case for `value = null` 
> and `dstType = char.class` is added, verifying the outcome is `'u0000'`.

This pull request has now been integrated.

Changeset: 937d61bf
Author:    Chen Liang <li...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/937d61bfbaba61117076c78358570ec4c35c8c42
Stats:     156 lines in 3 files changed: 57 ins; 80 del; 19 mod

8364751: ConstantBootstraps.explicitCast contradictory specification for 
null-to-primitive

Reviewed-by: jvernee, rriggs

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

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

Reply via email to