private void internalSetParent ( CommandRegistry parentRegistry ) { if ( ! ObjectUtils . nullSafeEquals ( this . parent , parentRegistry ) ) { if ( this . parent != null ) { this . parent . removeCommandRegistryListener ( this ) ; } this . parent = parentRegistry ; if ( this . parent != null ) { this . parent . addCommandRegistryListener ( this ) ; } } }
This method is provided as a private helper so that it can be called by the constructor instead of the constructor having to call the public overridable setParent method .