#vulnerable code 
                                public void handleOpenFailure(Buffer buffer) {
        int reason = buffer.getInt();
        String msg = buffer.getString();
        synchronized (lock) {
            this.openFailureReason = reason;
            this.openFailureMsg = msg;
            this.openFuture.setException(new SshException(msg));
            this.closeFuture.setClosed();
            this.doClose();
            lock.notifyAll();
        }
    } 
                            #location 3 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                public void handleOpenFailure(Buffer buffer) {
        int reason = buffer.getInt();
        String msg = buffer.getString();
        this.openFailureReason = reason;
        this.openFailureMsg = msg;
        this.openFuture.setException(new SshException(msg));
        this.closeFuture.setClosed();
        this.doClose();
        notifyStateChanged();
    }