#vulnerable code 
                                public void destroy() {
        System.out.println("---------peer destory:" + this.getIp());
        lock.lock();
        try {
            this.status = Peer.CLOSE;
            if (this.writeTarget != null) {
                this.writeTarget.closeConnection();
                this.writeTarget = null;
            }
        } finally {
            lock.unlock();
        }
        //todo check failCount and save or remove from database
        //this.failCount ++;

    } 
                            #location 2 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                public void destroy() {

        lock.lock();
        try {
            this.status = Peer.CLOSE;
            if (this.writeTarget != null) {
                this.writeTarget.closeConnection();
                this.writeTarget = null;
            }
        } finally {
            lock.unlock();
        }
        //todo check failCount and save or remove from database
        //this.failCount ++;

    }