Source:
<code>private Map<String, List<Long>> getInterestingFileMapForVHD(Path resultsPath) throws TskCoreException, IOException { Map<Long, List<String>> objIdToimagePathsMap = currentCase.getSleuthkitCase().getImagePaths(); imagePathToObjIdMap = imagePathsToDataSourceObjId(objIdToimagePathsMap); Map<String, List<Long>> interestingFileMap = new HashMap<>(); try (BufferedReader br = new BufferedReader(new InputStreamReader( new FileInputStream(resultsPath.toFile()), "UTF8"))) { String line; br.readLine(); int lineNumber = 2; while ((line = br.readLine()) != null) { if (cancelled) { break; } String[] fields = line.split("\t", -1); if (fields.length != 14) { throw new IOException(Bundle.AddLogicalImageTask_notEnoughFields(lineNumber, fields.length, 14)); } String vhdFilename = fields[0]; String fileMetaAddressStr = fields[2]; String ruleSetName = fields[4]; String ruleName = fields[5]; String filename = fields[7]; String parentPath = fields[8]; if (lineNumber % 100 == 0) { progressMonitor.setProgressText(Bundle.AddLogicalImageTask_searchingInterestingFile(lineNumber, totalFiles)); } String query = makeQuery(vhdFilename, fileMetaAddressStr, parentPath, filename); List<AbstractFile> matchedFiles = Case.getCurrentCase().getSleuthkitCase().findAllFilesWhere(query); List<Long> fileIds = new ArrayList<>(); for (AbstractFile file : matchedFiles) { fileIds.add(file.getId()); } String key = String.format("%s\t%s", ruleSetName, ruleName); List<Long> value = new ArrayList<>(); if (interestingFileMap.containsKey(key)) { <START> value = interestingFileMap.get(key); <END> } value.addAll(fileIds); interestingFileMap.put(key, value); lineNumber++; } } return interestingFileMap; }</code><technical_language>This simpler as: if (interestingFileMap.containsKey(key)) { interestingFileMap.get(key).addAll(fileIds); } else { interestingFileMap.put(key, fileIds); }</technical_language>

Target:
private Map<String, List<Long>> getInterestingFileMapForVHD(Path resultsPath) throws TskCoreException, IOException { Map<Long, List<String>> objIdToimagePathsMap = currentCase.getSleuthkitCase().getImagePaths(); imagePathToObjIdMap = imagePathsToDataSourceObjId(objIdToimagePathsMap); Map<String, List<Long>> interestingFileMap = new HashMap<>(); try (BufferedReader br = new BufferedReader(new InputStreamReader( new FileInputStream(resultsPath.toFile()), "UTF8"))) { String line; br.readLine(); int lineNumber = 2; while ((line = br.readLine()) != null) { if (cancelled) { break; } String[] fields = line.split("\t", -1); if (fields.length != 14) { throw new IOException(Bundle.AddLogicalImageTask_notEnoughFields(lineNumber, fields.length, 14)); } String vhdFilename = fields[0]; String fileMetaAddressStr = fields[2]; String ruleSetName = fields[4]; String ruleName = fields[5]; String filename = fields[7]; String parentPath = fields[8]; if (lineNumber % 100 == 0) { progressMonitor.setProgressText(Bundle.AddLogicalImageTask_searchingInterestingFile(lineNumber, totalFiles)); } String query = makeQuery(vhdFilename, fileMetaAddressStr, parentPath, filename); List<AbstractFile> matchedFiles = Case.getCurrentCase().getSleuthkitCase().findAllFilesWhere(query); List<Long> fileIds = new ArrayList<>(); for (AbstractFile file : matchedFiles) { fileIds.add(file.getId()); } String key = String.format("%s\t%s", ruleSetName, ruleName); if (interestingFileMap.containsKey(key)) { interestingFileMap.get(key).addAll(fileIds); } else { interestingFileMap.put(key, fileIds); } lineNumber++; } } return interestingFileMap; }