On Fri, 3 Apr 2026 14:39:35 GMT, Vicente Romero <[email protected]> wrote:

>> This PR is adding a new serialization warning for the case when a value 
>> class declares one of the following serialization related methods:
>> 
>> - readObject
>> - writeObject
>> - readObjectNoData
>> 
>> They have no effect if declared in value classes, fact that should be 
>> notified to the user,
>> 
>> TIA
>
> Vicente Romero has updated the pull request incrementally with five 
> additional commits since the last revision:
> 
>  - Merge branch 'JDK-8378908' of 
> https://github.com/vicente-romero-oracle/valhalla into JDK-8378908
>  - Apply suggestions from code review
>    
>    Co-authored-by: Chen Liang <[email protected]>
>  - Apply suggestion from @liach
>    
>    Co-authored-by: Chen Liang <[email protected]>
>  - Apply suggestion from @liach
>    
>    Co-authored-by: Chen Liang <[email protected]>
>  - addressing review comments

src/java.base/share/classes/java/time/chrono/HijrahDate.java line 667:

> 665:      */
> 666:     @java.io.Serial
> 667:     @SuppressWarnings("serial") // this method is not invoked for value 
> classes

Perhaps as future work, it would be technically possible for the serial lint 
checks to look inside the body of a method like this, notice the method always 
throws an exception, and elide the warning in that case. (It is a little 
unfortunate to "penalize" the java.time method for being robust in their serial 
handing by requiring new suppress warnings.)

Various known enhancements to the serial checking envision that deep inspection 
of lint checking, as in JDK-7019074.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2187#discussion_r3033466976

Reply via email to