Inspectopedia Help

Instance field may not be initialized by 'readObject()'

Reports fields that are not guaranteed to be initialized after the object is deserialized by the readObject() method.

The inspection doesn't report transient fields.

Note: This inspection uses a very conservative control flow algorithm, and may incorrectly report fields as uninitialized.


class DataObject implements Serializable { String s; // s is not initialized in readObject int i; private void readObject(ObjectInputStream stream) throws IOException { i = stream.readInt(); } }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Java, 233.SNAPSHOT

Last modified: 13 July 2023