On Mon, 2 Mar 2026 20:50:19 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
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java line 5132:
> 5130: if (serialMethodNames.contains(name)) {
> 5131: switch (name) {
> 5132: case "writeObject" ->
> isSerialMethodCorrect[0] = hasAppropriateWriteObject(tree, e, method);
some changes in this method and in the methods invoked here were not strictly
necessary but were done for the sake of uniformity
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2187#discussion_r2874833450