Groovy Documentation

groovy.org.codenarc.rule.concurrency
[Groovy] Class SynchronizedReadObjectMethodRule

java.lang.Object
  org.codenarc.rule.AbstractAstVisitorRule
      groovy.org.codenarc.rule.concurrency.SynchronizedReadObjectMethodRule

class SynchronizedReadObjectMethodRule
extends AbstractAstVisitorRule

Catches Serializable classes that define a synchronized readObject method. 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.

Authors:
Hamlet D'Arcy


Property Summary
Class astVisitorClass

String name

int priority

 

Property Detail

astVisitorClass

Class astVisitorClass


name

String name


priority

int priority


 

Groovy Documentation