#vulnerable code 
                             public BitSet getCompletedPieces() {
		synchronized (this.completedPieces) {
			return (BitSet)this.completedPieces.clone();
		}
	} 
                            #location 2 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                             public BitSet getCompletedPieces() {
		if (!this.isInitialized()) {
			throw new IllegalStateException("Torrent not yet initialized!");
		}

		synchronized (this.completedPieces) {
			return (BitSet)this.completedPieces.clone();
		}
	}