-
Enhancement
-
Resolution: Fixed
-
P3
-
11
-
b21
There are other useful checks that could be added, including that serial-involved methods are properly declared rather than being overloads which will get ignored by the serialization system. Those methods include:
private void writeObject(java.io.ObjectOutputStream stream)
throws IOException;
private void readObject(java.io.ObjectInputStream stream)
throws IOException, ClassNotFoundException;
private void readObjectNoData()
throws ObjectStreamException
as discussed in java.io.ObjectInputStream and java.io.ObjectOutputStream. In additional, the serialization spec discusses the methods:
ANY-ACCESS-MODIFIER Object writeReplace()
throws ObjectStreamException;
ANY-ACCESS-MODIFIER Object readResolve()
throws ObjectStreamException;
Additional methods are defined for Externalization.
- csr for
-
JDK-8274335 Expand serial warning to check for bad overloads of serial-related methods and ineffectual fields
- Closed
- duplicates
-
JDK-8002086 javac should warn if serialVersionUID is present in an enum or anon subclass of an enum
- Closed
- relates to
-
JDK-8310861 Improve location reporting for javac serial lint warnings
- Resolved
-
JDK-8207816 Align declaration of SerializedLambda.readResolve with serialization conventions
- Resolved
-
JDK-8275013 Improve discussion of serialization method declarations in java.io.Object{Input, Output}Stream
- Resolved
-
JDK-8205397 InetAddress has wrong declaration for readObjectNoData
- Closed
-
JDK-8207751 Remove misleading serialVersionUID from JulienFields.Field
- Closed
-
JDK-8208060 Additional corrections of serial-related declarations
- Closed
-
JDK-8209024 Use SuppressWarnings on serialVersionUID fields in interfaces
- Closed
-
JDK-8275667 Refactor serial lint checks to be tree-based
- Open
-
JDK-8202385 Annotation to mark serial-related fields and methods
- Resolved
-
JDK-8203263 Remove unnecessary throws clauses from serialization-related methods
- Resolved
-
JDK-8310835 Address gaps in -Xlint:serial checks
- Resolved
-
JDK-4397681 MediaTracker serialization spec refer package-protected field MediaEntry
- Open
-
JDK-8241151 Incorrect lint warning for no definition of serialVersionUID in a record
- Resolved
-
JDK-8274255 Update javac messages to use "enum class" rather than "enum type"
- Resolved
-
JDK-8208782 Remove extra type in throws clause of SerialClob.writeObject
- Closed
-
JDK-7019074 -Xlint serial flag could perform correctness checks on readObject/writeObject
- Open
-
JDK-4767441 new warning: class implements serializable but doesn't define serialVersionUID
- Resolved
-
JDK-8160675 Issue lint warning for non-serializable non-transient instance fields in serializable type
- Resolved
-
JDK-8229999 Apply java.io.Serial annotations to security types in java.base
- Resolved