#vulnerable code 
                                @Override public void shutdown() {
        if (eventConnection != null && (eventConnection.getState() == ManagerConnectionState.CONNECTED || eventConnection.getState() == ManagerConnectionState.RECONNECTING)) {
						try {
							eventConnection.logoff();
						} catch (Exception ignore) {}
        }
				
        if (managerEventListenerProxy != null) {
						if (eventConnection != null) {
							eventConnection.removeEventListener(managerEventListenerProxy);
						}
            managerEventListenerProxy.shutdown();
        }

		    if (eventConnection != null && eventListener != null) {
			    eventConnection.removeEventListener(eventListener);
	      }

		    managerEventListenerProxy = null;
        eventListener = null;

	      if (initialized) {//incredible, but it happened
		      handleDisconnectEvent(null);
	      }//i
    } 
                            #location 23 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                @Override public void shutdown() {
        if (eventConnection != null && (eventConnection.getState() == ManagerConnectionState.CONNECTED || eventConnection.getState() == ManagerConnectionState.RECONNECTING)) {
						try {
							eventConnection.logoff();
						} catch (Exception ignore) {}
        }
				
        if (managerEventListenerProxy != null) {
						if (eventConnection != null) {
							eventConnection.removeEventListener(managerEventListenerProxy);
						}
            managerEventListenerProxy.shutdown();
        }

		if (eventConnection != null && eventListener != null) {
		    	eventConnection.removeEventListener(eventListener);
	    }

		managerEventListenerProxy = null;
        eventListener = null;

	    if (initialized) {//incredible, but it happened
	    	handleDisconnectEvent(null);
	    }//i
    }