
resources.report.rules.findbugs.RS_READOBJECT_SYNC.html Maven / Gradle / Ivy
RS: Class's readObject() method is synchronized (RS_READOBJECT_SYNC)
RS: Class's readObject() method is synchronized (RS_READOBJECT_SYNC)
This serializable class defines a readObject()
which is
synchronized. By definition, an object created by deserialization
is only reachable by one thread, and thus there is no need for
readObject()
to be synchronized. If the readObject()
method itself is causing the object to become visible to another thread,
that is an example of very dubious coding style.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy