#vulnerable code 
                                @Override
    public void onLinkRemoteClose(Event event)
    {
        logger.LogDebug("Entered in method %s", logger.getMethodName());
        this.state = State.CLOSED;

        String linkName = event.getLink().getName();
        if (this.amqpsSessionManager.isLinkFound(linkName))
        {
            logger.LogInfo("Starting to reconnect to IotHub, method name is %s ", logger.getMethodName());
            // Codes_SRS_AMQPSIOTHUBCONNECTION_15_048: [The event handler shall attempt to startReconnect to IoTHub.]
            startReconnect();
        }
        logger.LogDebug("Exited from method %s", logger.getMethodName());
    } 
                            #location 12 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                @Override
    public void onLinkRemoteClose(Event event)
    {
        logger.LogDebug("Entered in method %s", logger.getMethodName());

        this.state = State.CLOSED;

        String linkName = event.getLink().getName();
        if (this.amqpsSessionManager.isLinkFound(linkName))
        {
            logger.LogInfo("Starting to reconnect to IotHub, method name is %s ", logger.getMethodName());
            // Codes_SRS_AMQPSIOTHUBCONNECTION_15_048: [The event handler shall attempt to startReconnect to IoTHub.]
            startReconnect();
        }

        logger.LogDebug("Exited from method %s", logger.getMethodName());
    }