diff --git a/Core/src/org/sleuthkit/autopsy/actions/TagAction.java b/Core/src/org/sleuthkit/autopsy/actions/TagAction.java index 6b5615a812..a540ce878a 100755 --- a/Core/src/org/sleuthkit/autopsy/actions/TagAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/TagAction.java @@ -48,6 +48,7 @@ import org.sleuthkit.datamodel.BlackboardArtifact; * Derived classes should call this method any time a tag is created, updated * or deleted outside of an actionPerformed() call. */ + @SuppressWarnings("deprecation") protected void refreshDirectoryTree() { /* Note: this is a hack. In an ideal world, TagsManager would fire events so diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java b/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java index 0d6f972475..cc7958355e 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/Tags.java @@ -119,10 +119,16 @@ public class Tags implements AutopsyVisitableItem { private final PropertyChangeListener pcl = new PropertyChangeListener() { @Override + @SuppressWarnings("deprecation") public void propertyChange(PropertyChangeEvent evt) { String eventType = evt.getPropertyName(); if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) { - if ((((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_ARTIFACT) || ((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_FILE) { + /* Note: this is a hack. In an ideal world, TagsManager + * would fire events so that the directory tree would + * refresh. But, we haven't had a chance to add that so, we + * fire these events and the tree refreshes based on them. */ + if ((((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_ARTIFACT) + || ((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_FILE) { refresh(true); tagResults.update(); } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java index 2660c40be9..8f3e3770f1 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java @@ -36,18 +36,17 @@ import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.HashSet; import java.util.concurrent.ExecutionException; import java.util.logging.Level; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.SwingWorker; import org.openide.filesystems.FileUtil; -import org.openide.util.Exceptions; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.EscapeUtil; @@ -540,6 +539,7 @@ import org.sleuthkit.datamodel.TskData; /** * Make table for tagged files */ + @SuppressWarnings("deprecation") private void makeContentTagsTables() { // Check for cancellaton. removeCancelledTableReportModules(); @@ -638,6 +638,7 @@ import org.sleuthkit.datamodel.TskData; /** * Generate the tables for the tagged artifacts */ + @SuppressWarnings("deprecation") private void makeBlackboardArtifactTagsTables() { // Check for cancellaton. removeCancelledTableReportModules(); @@ -1686,7 +1687,8 @@ import org.sleuthkit.datamodel.TskData; * @param artifactId * @return hash set of tag display names * @throws SQLException - */ + */ + @SuppressWarnings("deprecation") private HashSet getUniqueTagNames(long artifactId) throws SQLException { HashSet uniqueTagNames = new HashSet<>(); ResultSet tagNameRows = skCase.runQuery("SELECT display_name, artifact_id FROM tag_names AS tn, blackboard_artifact_tags AS bat " + //NON-NLS @@ -1694,6 +1696,7 @@ import org.sleuthkit.datamodel.TskData; while (tagNameRows.next()) { uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS } + skCase.closeRunQuery(tagNameRows); return uniqueTagNames; }