From a93ea4b93cb62481b7d42b0970203bfd4f7c93fc Mon Sep 17 00:00:00 2001
From: William Schaefer <wschaefer@basistech.net>
Date: Tue, 15 Jan 2019 17:25:05 -0500
Subject: [PATCH] 4629 fix attributes to be associated with just their artifact

---
 .../autopsy/recentactivity/DataSourceUsageAnalyzer.java        | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/DataSourceUsageAnalyzer.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/DataSourceUsageAnalyzer.java
index 9f9d0fb420..f429d7bb2e 100644
--- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/DataSourceUsageAnalyzer.java
+++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/DataSourceUsageAnalyzer.java
@@ -80,7 +80,6 @@ private void checkForOSFiles(List<String> filesToCheckFor, String dataSourceUsag
             //shortcut out if it was called with no artifacts to create
             return;
         }
-        Collection<BlackboardAttribute> bbattributes = new ArrayList<>();
         FileManager fileManager = currentCase.getServices().getFileManager();
         List<AbstractFile> files = new ArrayList<>();
         for (String filePath : filesToCheckFor) {
@@ -89,12 +88,14 @@ private void checkForOSFiles(List<String> filesToCheckFor, String dataSourceUsag
         //create an artifact if any files with the windows/system32 specific path were found
         if (!files.isEmpty()) {
             if (!dataSourceUsageDescription.isEmpty()) {
+                Collection<BlackboardAttribute> bbattributes = new ArrayList<>();
                 bbattributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DESCRIPTION,
                         Bundle.DataSourceUsageAnalyzer_parentModuleName(),
                         dataSourceUsageDescription)); //NON-NLS
                 addArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_DATA_SOURCE_USAGE, dataSource, bbattributes);
             }
             if (!osInfoProgramName.isEmpty()) {
+                Collection<BlackboardAttribute> bbattributes = new ArrayList<>();
                 bbattributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME,
                         Bundle.DataSourceUsageAnalyzer_parentModuleName(),
                         osInfoProgramName)); //NON-NLS
-- 
GitLab