private void checkForCircularReference ( ) { ElementLayout layout = this ; while ( ( layout = layout . getAncestor ( ElementLayout . class ) ) != null ) { if ( layout . linked && layout . shared == shared && layout . layoutName . equals ( layoutName ) ) { CWFException . raise ( "Circular reference to layout " + layoutName ) ; } } }
Checks for a circular reference to the same linked layout throwing an exception if found .