On Thu, 4 Jun 2026 13:13:07 GMT, Chen Liang <[email protected]> wrote:
>> 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.
Makes sense. I wonder if it would be easier (for future PRs in this space) to
do the mainline-alignment as a separate, initial, PR, then do a follow-up PR
with the specific changes.
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2326#discussion_r3356327525