On Fri, 16 Oct 2026 17:30:52 GMT, Bill Huang <[email protected]> wrote:

> This follows JDK-8394676 (#33391), which removed the duplicated VClass test 
> code from the java/util/Collections tests. It replaces #32201 and keeps value 
> class coverage only where the java.util code under test behaves differently 
> for value objects.
> 
> HashMap/PutNullKey.java
> When colliding keys in a HashMap tree bin are not Comparable, 
> HashMap.TreeNode.tieBreakOrder orders them by System.identityHashCode. For a 
> value object, the identity hash code is derived from the object's field 
> values, so the tree takes a different shape than with identity objects. No 
> existing test reaches this path, even with identity keys: every colliding-key 
> test uses Comparable keys.
> 
> Collections/Ser.java
> Refactoring only, with no change in behavior or coverage. Ser already covers 
> serializing Collections.singleton and nCopies with a value class element 
> through a writeReplace/readResolve proxy. This change only consolidates its 
> six identical serialize/deserialize/compare blocks into one helper method.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: 6ed82b3b
Author:    Bill Huang <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/6ed82b3b15804a9e6b1d93513936db0d10e40a7e
Stats:     137 lines in 3 files changed: 45 ins; 74 del; 18 mod

8384611: Improve value class test coverage in java/util Collections/Ser and 
HashMap/PutNullKey

Reviewed-by: smarks

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

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

Reply via email to