private synchronized void switchTree ( SmbTreeImpl t ) {
        try ( SmbTreeImpl old = getTree() ) {
            if ( old == t ) {
                return;
            }
            boolean wasAcquired = this.treeAcquired;
            log.debug("Switching tree");
            if ( t != null ) {
                log.debug("Acquired tree on switch " + t);
                t.acquire();
                this.treeAcquired = true;
            }
            else {
                this.treeAcquired = false;
            }

            this.tree = t;
            if ( old != null ) {
                if ( wasAcquired ) {
                    // release
                    old.release(true);
                }
            }
            if ( this.delegate != null && this.delegateAcquired ) {
                log.debug("Releasing delegate");
                this.delegateAcquired = false;
                this.delegate.release();
            }
        }
    }
private synchronized void switchTree ( SmbTreeImpl t ) { try ( SmbTreeImpl old = getTree ( ) ) { if ( old == t ) { return ; } boolean wasAcquired = this . treeAcquired ; log . debug ( "Switching tree" ) ; if ( t != null ) { log . debug ( "Acquired tree on switch " + t ) ; t . acquire ( ) ; this . treeAcquired = true ; } else { this . treeAcquired = false ; } this . tree = t ; if ( old != null ) { if ( wasAcquired ) { old . release ( true ) ; } } if ( this . delegate != null && this . delegateAcquired ) { log . debug ( "Releasing delegate" ) ; this . delegateAcquired = false ; this . delegate . release ( ) ; } } }
@param t