#vulnerable code 
                                public void changeRoleToCandidate(long term) {
        logger.info("[{}][ChangeRoleToCandidate] from term: {} and currterm: {}", memberState.getSelfId(), term, memberState.currTerm());
        memberState.changeToCandidate(term);
        nextTimeToRequestVote = -1;
    } 
                            #location 4 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                public void changeRoleToCandidate(long term) {
        logger.info("[{}][ChangeRoleToCandidate] from term: {} and currterm: {}", memberState.getSelfId(), term, memberState.currTerm());
        memberState.changeToCandidate(term);
    }