#vulnerable code 
                             @Override
	public void copySnapshot() {
		int length = dirtyIndex.get();
		if (length <= dirtyArray.length) {
			for (int i = 0; i < length; i++) {
				int index = dirtyArray[i];
				this.snapshot[index] = live[index];
			}
		} else {
			for (int i = 0; i < live.length; i++) {
				this.snapshot[i] = live[i];
			}
		}
	} 
                            #location 6 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                             @Override
	public void copySnapshot() {
		int length = dirtyIndex.get();
		if (length <= dirtySize) {
			for (int i = 0; i < length; i++) {
				int index = dirtyArray.get(i);
				this.snapshot[index] = getLive(i);
			}
		} else {
			for (int i = 0; i < snapshot.length; i++) {
				this.snapshot[i] = getLive(i);
			}
		}
	}