From 23ebc24e28b89863fb0dd5e882897ffb47fee5ee Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Tue, 18 Sep 2018 10:15:51 -0400 Subject: [PATCH] Fix bug with how the final common properties were being added to the results. --- .../InterCaseSearchResultsProcessor.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/InterCaseSearchResultsProcessor.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/InterCaseSearchResultsProcessor.java index d258db2cc1..2aab1d3078 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/InterCaseSearchResultsProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/InterCaseSearchResultsProcessor.java @@ -212,11 +212,16 @@ final class InterCaseSearchResultsProcessor { countAndAddCommonAttributes(corValue, resultId); } - //Add the final instances - CommonAttributeValueList value = new CommonAttributeValueList(); + //Add the final instance(s) if (commonAttributeValue != null) { - value.addMetadataToList(commonAttributeValue); - instanceCollatedCommonFiles.put(commonAttributeValue.getInstanceCount(), value); + int size = commonAttributeValue.getInstanceCount(); + if (instanceCollatedCommonFiles.containsKey(size)) { + instanceCollatedCommonFiles.get(size).addMetadataToList(commonAttributeValue); + } else { + CommonAttributeValueList value = new CommonAttributeValueList(); + value.addMetadataToList(commonAttributeValue); + instanceCollatedCommonFiles.put(size, value); + } } } catch (SQLException ex) { LOGGER.log(Level.WARNING, "Error getting artifact instances from database.", ex); // NON-NLS