Groovy Documentation

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

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

class ThisReferenceEscapesConstructorRule
extends AbstractAstVisitorRule

Reports constructors passing the 'this' reference to other methods. This equals exposing a half-baked objects and can lead to race conditions during initialization. For reference, see Java Concurrency Gotchas by Alex Miller and Java theory and practice: Safe construction techniques by Brian Goetz.

Authors:
Artur Gajowy


Property Summary
Class astVisitorClass

String name

int priority

 

Property Detail

astVisitorClass

Class astVisitorClass


name

String name


priority

int priority


 

Groovy Documentation