#fixed code
                                DeviceClientManager(DeviceClient deviceClient, boolean autoReconnectOnDisconnected) {
        this.connectionStatus = ConnectionStatus.DISCONNECTED;
        this.client = deviceClient;
        this.client.registerConnectionStatusChangeCallback(this, this);
        this.autoReconnectOnDisconnected = autoReconnectOnDisconnected;
    }
#vulnerable code 
                                void disconnect() {
        try {
            log.debug("[disconnect] - Closing the device client instance...");
            client.closeNow();
        }
        catch (IOException e) {
            log.error("[disconnect] - Exception thrown while closing DeviceClient instance: ", e);
        }
    } 
                            #location 4 
                            #vulnerability type THREAD_SAFETY_VIOLATION