On Fri, 5 Jun 2026 15:11:36 GMT, Alan Bateman <[email protected]> wrote:

>> Chen Liang has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Use explicit types for confusing variables
>
> src/java.base/share/classes/java/io/ObjectStreamClass.java line 1440:
> 
>> 1438:                 Arrays.stream(clazz.getDeclaredMethods()).filter(m -> 
>> Modifier.isStatic(m.getModifiers())),
>> 1439:                 Arrays.stream(clazz.getDeclaredConstructors()))
>> 1440:                 .filter(m -> 
>> m.isAnnotationPresent(DeserializeConstructor.class))
> 
> If it turns out we only use this on the wrapper constructors then I would be 
> tempted to leave the static factory support for the code going to main line. 
> I note your comment in the mainline PR about having flexibility but keeping 
> unused code would be good, if possible.

I currently have cases actively testing static factories in 
test/jdk/java/io/Serializable/valueObjects/SerializedObjectCombo.java. I think 
this support has very low overhead and in the long run, we still might want to 
move back to using `valueOf` if we can eliminate regressions.

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

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

Reply via email to