#vulnerable code 
                                public void unsubscribeRange(int from, int to) {
        synchronized(this) {
            for (int i = from; i <= to; i++) {
                if(ids.contains(i)) {
                    ids.remove(i);
                    changeReceiver.unsubscribed(i, this);
                }
            }
        }
        logStatus();
    } 
                            #location 10 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                public void unsubscribeRange(int from, int to) {
        synchronized(ids) {
            for (int i = from; i <= to; i++) {
                if(ids.contains(i)) {
                    ids.remove(i);
                    changeReceiver.unsubscribed(i, this);
                }
            }
        }
    }