...
Code Block | ||
---|---|---|
| ||
private void readObject(final ObjectInputStream stream) throws
IOException, ClassNotFoundException {
overridableMethod();
stream.defaultReadObject();
}
|
Compliant Solution
This compliant solution removes the call to the overridable method.
Code Block | ||
---|---|---|
| ||
private void readObject(final ObjectInputStream stream) throws
IOException, ClassNotFoundException {
stream.defaultReadObject();
}
|
Risk Assessment
Invoking overridable methods from the readObject()
method can lead to initialization errors.
...