Source:
private void populateCentralRepositoryData(StringBuilder html, BlackboardArtifact artifact, AbstractFile sourceFile) { if (EamDb.isEnabled()) { startSection(html, "Central Repository Comments"); List<CorrelationAttributeInstance> instancesList = new ArrayList<>(); if (artifact != null) { instancesList.addAll(EamArtifactUtil.makeInstancesFromBlackboardArtifact(artifact, false)); } try { List<CorrelationAttributeInstance.Type> artifactTypes = EamDb.getInstance().getDefinedCorrelationTypes(); String md5 = sourceFile.getMd5Hash(); if (md5 != null && !md5.isEmpty() && null != artifactTypes && !artifactTypes.isEmpty()) { for (CorrelationAttributeInstance.Type attributeType : artifactTypes) { if (attributeType.getId() == CorrelationAttributeInstance.FILES_TYPE_ID) { CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getCurrentCase()); instancesList.add(new CorrelationAttributeInstance( md5, attributeType, correlationCase, CorrelationDataSource.fromTSKDataSource(correlationCase, sourceFile.getDataSource()), sourceFile.getParentPath() + sourceFile.getName(), "", sourceFile.getKnown())); break; } } } boolean commentDataFound = false; for (CorrelationAttributeInstance instance : instancesList) { List<CorrelationAttributeInstance> correlatedInstancesList = EamDb.getInstance().getArtifactInstancesByTypeValue(instance.getCorrelationType(), instance.getCorrelationValue()); for (CorrelationAttributeInstance correlatedInstance : correlatedInstancesList) { if (correlatedInstance.getComment() != null && correlatedInstance.getComment().isEmpty() == false) { commentDataFound = true; addCentralRepositoryEntry(html, correlatedInstance); } } } if (commentDataFound == false) { addMessage(html, "There is no comment data for the selected content in the central repository."); } } catch (EamDbException | TskCoreException | CorrelationAttributeNormalizationException ex) { logger.log(Level.SEVERE, "Error connecting to the central repository database.", ex); } endSection(html); } }

Target:
private void populateCentralRepositoryData(StringBuilder html, BlackboardArtifact artifact, AbstractFile sourceFile) { if (EamDb.isEnabled()) { startSection(html, "Central Repository Comments"); List<CorrelationAttributeInstance> instancesList = new ArrayList<>(); if (artifact != null) { instancesList.addAll(EamArtifactUtil.makeInstancesFromBlackboardArtifact(artifact, false)); } try { List<CorrelationAttributeInstance.Type> artifactTypes = EamDb.getInstance().getDefinedCorrelationTypes(); String md5 = sourceFile.getMd5Hash(); if (md5 != null && !md5.isEmpty() && null != artifactTypes && !artifactTypes.isEmpty()) { for (CorrelationAttributeInstance.Type attributeType : artifactTypes) { if (attributeType.getId() == CorrelationAttributeInstance.FILES_TYPE_ID) { CorrelationCase correlationCase = EamDb.getInstance().getCase(Case.getCurrentCase()); instancesList.add(new CorrelationAttributeInstance( md5, attributeType, correlationCase, CorrelationDataSource.fromTSKDataSource(correlationCase, sourceFile.getDataSource()), sourceFile.getParentPath() + sourceFile.getName(), "", sourceFile.getKnown())); break; } } } boolean commentDataFound = false; for (CorrelationAttributeInstance instance : instancesList) { List<CorrelationAttributeInstance> correlatedInstancesList = EamDb.getInstance().getArtifactInstancesByTypeValue(instance.getCorrelationType(), instance.getCorrelationValue()); for (CorrelationAttributeInstance correlatedInstance : correlatedInstancesList) { if (correlatedInstance.getComment() != null && correlatedInstance.getComment().isEmpty() == false) { commentDataFound = true; addCentralRepositoryEntry(html, correlatedInstance); } } } if (commentDataFound == false) { addMessage(html, "There is no comment data for the selected content in the central repository."); } } catch (EamDbException | TskCoreException ex) { logger.log(Level.SEVERE, "Error connecting to the central repository database.", ex); } catch (CorrelationAttributeNormalizationException ex) { logger.log(Level.SEVERE, "Error normalizing instance from repository database.", ex); } endSection(html); } }