On Thu, 4 Jun 2026 11:45:03 GMT, Viktor Klang <[email protected]> wrote:
>> 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
`i == null` is not straightforward for "name mismatch" case. I should make that
comment more specific, like "Name not accounted by the factory" and "Name
match, 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));
> }
> }
This is how it is in mainline, I don't think I should introduce noisy diff to
the mainline review PR.
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2326#discussion_r3356214978
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2326#discussion_r3356221874