Back to Intellij Community

NonSerializableWithSerializationMethods

java/java-impl/resources/inspectionDescriptions/NonSerializableWithSerializationMethods.html

2025.3-rc-2310 B
Original Source

Reports non-Serializable classes that define readObject() or writeObject() methods. Such methods in that context normally indicate an error.

Example:

public class SampleClass {
    private void readObject(ObjectInputStream str) {}
    private void writeObject(ObjectOutputStream str) {}
  }