From 334b9c55c2ccf0b9f10e6f5de8b4cf34a7f16a1c Mon Sep 17 00:00:00 2001 From: millmanorama Date: Wed, 15 Aug 2018 12:00:00 +0200 Subject: [PATCH] fix codacy and netbeans hints --- Core/src/org/sleuthkit/autopsy/casemodule/Case.java | 10 ++-------- .../modules/exif/ExifParserFileIngestModule.java | 5 +---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index b7c3c32ee1..64788b2056 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -18,7 +18,6 @@ */ package org.sleuthkit.autopsy.casemodule; -import com.google.common.collect.ImmutableSet; import com.google.common.eventbus.Subscribe; import java.awt.Frame; import java.awt.event.ActionEvent; @@ -35,9 +34,7 @@ import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.text.SimpleDateFormat; -import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -61,7 +58,6 @@ import javax.annotation.concurrent.GuardedBy; import javax.annotation.concurrent.ThreadSafe; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; -import org.openide.util.Exceptions; import org.openide.util.Lookup; import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; @@ -70,7 +66,6 @@ import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.actions.OpenOutputFolderAction; import org.sleuthkit.autopsy.appservices.AutopsyService; import org.sleuthkit.autopsy.appservices.AutopsyService.CaseContext; -import static org.sleuthkit.autopsy.casemodule.Bundle.*; import org.sleuthkit.autopsy.casemodule.CaseMetadata.CaseMetadataException; import org.sleuthkit.autopsy.casemodule.events.AddingDataSourceEvent; import org.sleuthkit.autopsy.casemodule.events.AddingDataSourceFailedEvent; @@ -116,7 +111,6 @@ import org.sleuthkit.autopsy.timeline.OpenTimelineAction; import org.sleuthkit.autopsy.timeline.events.EventAddedEvent; import org.sleuthkit.datamodel.Blackboard; import org.sleuthkit.datamodel.BlackboardArtifact; -import org.sleuthkit.datamodel.BlackboardArtifact.Type; import org.sleuthkit.datamodel.BlackboardArtifactTag; import org.sleuthkit.datamodel.CaseDbConnectionInfo; import org.sleuthkit.datamodel.Content; @@ -2013,10 +2007,10 @@ public class Case { try { caseDb = SleuthkitCase.openCase(databaseName, UserPreferences.getDatabaseConnectionInfo(), metadata.getCaseDirectory()); } catch (UserPreferencesException ex) { - throw new CaseActionException(Case_databaseConnectionInfo_error_msg(), ex); + throw new CaseActionException(Bundle.Case_databaseConnectionInfo_error_msg(), ex); } } else { - throw new CaseActionException(Case_open_exception_multiUserCaseNotEnabled()); + throw new CaseActionException(Bundle.Case_open_exception_multiUserCaseNotEnabled()); } } catch (TskUnsupportedSchemaVersionException ex) { throw new CaseActionException(Bundle.Case_unsupportedSchemaVersionMessage(), ex); diff --git a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java index 10d7f5167f..88485a6b4f 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java @@ -144,8 +144,7 @@ public final class ExifParserFileIngestModule implements FileIngestModule { private ProcessResult processFile(AbstractFile f) { - try (InputStream in = new ReadContentInputStream(f); - BufferedInputStream bin = new BufferedInputStream(in);) { + try (BufferedInputStream bin = new BufferedInputStream(new ReadContentInputStream(f));) { Collection attributes = new ArrayList<>(); Metadata metadata = ImageMetadataReader.readMetadata(bin); @@ -263,8 +262,6 @@ public final class ExifParserFileIngestModule implements FileIngestModule { MessageNotifyUtil.Notify.error(Bundle.ExifParserFileIngestModule_indexError_message(), ""); } artifactsToPost.clear(); - } else { - } } }