...
Code Block | ||
---|---|---|
| ||
private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); } |
Exceptions
SER09-J-EX0: The readObject()
method may invoke the overridable methods defaultReadObject()
and readFields()
in class java.io.ObjectInputStream
[SCG 2009].
...
Invoking overridable methods from the readObject()
method can lead to initialization errors.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
SER09-J | Low | Probable | Medium | P4 | L3 |
Automated Detection
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
Parasoft Jtest |
| CERT.SER09.VREADOBJ | Do not invoke overridable methods from the readObject() method |
Related Guidelines
Guideline 7-4 / OBJECT-4: Prevent constructors from calling methods that can be overridden |
Bibliography
...
...