#vulnerable code 
                             public void updateFileCache() {
		mp3Files = getFileSet(Directories.MP3);
		aaxFiles = getFileSet(Directories.AAX);
		needFileCacheUpdate = System.currentTimeMillis();
		
		HashSet<Book> c = new HashSet<>();
		HashSet<Book> d = new HashSet<>();
		long seconds = 0;
		
		for (Book b : getBooks()) {
			if (isIgnoredBook(b)) continue;
			
			if (canDownload(b)) d.add(b);
			if (canConvert(b)) c.add(b);
			seconds += TimeToSeconds.parseTimeStringToSeconds(b.getDuration());
		}
		synchronized (lock) {
			toDownload.clear();
			toDownload.addAll(d);
			toConvert.clear();
			toConvert.addAll(c);
			totalDuration = seconds;
		}
		
	} 
                            #location 13 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                             public void updateFileCache() {
		mp3Files = getFileSet(Directories.MP3);
		aaxFiles = getFileSet(Directories.AAX);
		needFileCacheUpdate = System.currentTimeMillis();
		synchronized (lock) {
			toDownload.clear();
			toConvert.clear();
			long seconds = 0;
			for (Book b : getBooks()) {
				if (isIgnoredBook(b)) continue;
				
				if (canDownload(b)) toDownload.add(b);
				if (canConvert(b)) toConvert.add(b);
				seconds += TimeToSeconds.parseTimeStringToSeconds(b.getDuration());
			}
			totalDuration = seconds;
		}
		
	}