On Thu, 4 Jun 2026 14:07:55 GMT, Chen Liang <[email protected]> wrote:
>> test/jdk/java/io/Serializable/valueObjects/ValueSerializationTest.java line
>> 113:
>>
>>> 111: for (var f :
>>> NonSerializableStrictPoint.class.getDeclaredFields()) {
>>> 112: assertTrue(f.isStrictInit(), f.getName());
>>> 113: }
>>
>> I think it would be good to also validate that we are indeed seeing the
>> fields (i.e. assert that we see "x" and "y")
>
> That would be an assertion on the `getDeclaredFields` facility. I am more
> concerned about this annotation processing because the `@driver` clause is
> more likely to be accidentally omitted or have typos in test directives and
> becomes hard to debug. There is no such problem with
> `Class.getDeclaredFields` so I don't think field omissions is a problem.
I think there's a semantic difference between asserting "any fields returned
must be strict" and "two fields are to be returned, named "x" and "y" and they
must both be strict".
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2326#discussion_r3356736104