Inspectopedia Help

'serialPersistentFields' field not declared 'private static final ObjectStreamField[]'

Reports Serializable classes whose serialPersistentFields field is not declared as private static final ObjectStreamField[].

If a serialPersistentFields field is not declared with those modifiers, the serialization behavior will be as if the field was not declared at all.


class List implements Serializable { private List next; ObjectStreamField[] serialPersistentFields = {new ObjectStreamField("next", List.class)}; }

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Java, 241.14841

Last modified: 12 March 2024