On Mon, 18 May 2026 18:21:47 GMT, Chen Liang <[email protected]> wrote:

>> For preview of the serialization implementation cleanup.
>> 
>> See the mainline diff version:
>> https://gist.github.com/a3440f2b9da5111fe20315e59ed17380
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Chen Liang has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Message updated

src/java.base/share/classes/java/io/ObjectStreamClass.java line 1384:

> 1382:             }
> 1383:             if (!field.getType().equals(params[i])) {
> 1384:                 return false;

Suggestion:

                return false; // Type mismatch

src/java.base/share/classes/java/io/ObjectStreamClass.java line 1660:

> 1658:                 list.add(new ObjectStreamField(clFields[i], false, 
> true));
> 1659:             }
> 1660:         }

Since we aren't using the index beyond looking at the "current" array index 
value, we might as well remove that complication:

Suggestion:

        for (var clField : clFields.length) {
if ((clField.getModifiers() & mask) == 0) {
                list.add(new ObjectStreamField(clField, false, true));
}
}

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2326#discussion_r3355723078
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2326#discussion_r3355732635

Reply via email to