Merge pull request #7335 from kellykelly3/8021-cvt-other-occurences

8021 Removed current case from the CVT summary list of other occurrences
This commit is contained in:
Ann Priestman 2021-10-12 08:38:29 -04:00 committed by GitHub
commit e1860ff3b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,7 @@ import org.openide.nodes.ChildFactory;
import org.openide.nodes.Children;
import org.openide.nodes.Node;
import org.openide.nodes.Sheet;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoAccount;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeNormalizationException;
@ -74,6 +75,8 @@ final class CorrelationCaseChildNodeFactory extends ChildFactory<CorrelationCase
Map<String, CorrelationCase> uniqueCaseMap = new HashMap<>();
String currentCaseName = Case.getCurrentCase().getName();
accounts.forEach((account) -> {
try {
Optional<CorrelationAttributeInstance.Type> optCorrelationType = getCorrelationType(account.getAccountType());
@ -81,7 +84,9 @@ final class CorrelationCaseChildNodeFactory extends ChildFactory<CorrelationCase
List<CorrelationAttributeInstance> correlationInstances = dbInstance.getArtifactInstancesByTypeValue(optCorrelationType.get(), account.getTypeSpecificID());
correlationInstances.forEach((correlationInstance) -> {
CorrelationCase correlationCase = correlationInstance.getCorrelationCase();
if(!correlationCase.getCaseUUID().equals(currentCaseName)) {
uniqueCaseMap.put(correlationCase.getCaseUUID(), correlationCase);
}
});
}
} catch (CentralRepoException | CorrelationAttributeNormalizationException ex) {