5118 remove uses of exception.printStacktrace

This commit is contained in:
William Schaefer 2019-07-30 11:33:33 -04:00
parent 1cca4bf20a
commit 50e7d7e986
12 changed files with 17 additions and 17 deletions

View File

@ -573,7 +573,7 @@ final class OptionalCasePropertiesPanel extends javax.swing.JPanel {
examinerTextField.getText(), tfExaminerPhoneText.getText(), examinerTextField.getText(), tfExaminerPhoneText.getText(),
tfExaminerEmailText.getText(), taNotesText.getText())); tfExaminerEmailText.getText(), taNotesText.getText()));
} catch (CaseActionException ex) { } catch (CaseActionException ex) {
Exceptions.printStackTrace(ex); logger.log(Level.WARNING, "Error updating case details", ex);
} }
} }
} }

View File

@ -62,7 +62,6 @@ public class StartupWindowProvider implements StartupWindowInterface {
if (isRunningFromCommandLine()) { if (isRunningFromCommandLine()) {
// Autopsy is running from command line // Autopsy is running from command line
logger.log(Level.INFO, "Running from command line"); //NON-NLS logger.log(Level.INFO, "Running from command line"); //NON-NLS
System.out.println("Running from command line");
startupWindowToUse = new CommandLineStartupWindow(); startupWindowToUse = new CommandLineStartupWindow();
// kick off command line processing // kick off command line processing
new CommandLineIngestManager().start(); new CommandLineIngestManager().start();

View File

@ -74,7 +74,7 @@ final class ManageCorrelationPropertiesDialog extends javax.swing.JDialog {
correlationTypes.clear(); correlationTypes.clear();
correlationTypes.addAll(dbManager.getDefinedCorrelationTypes()); correlationTypes.addAll(dbManager.getDefinedCorrelationTypes());
} catch (EamDbException ex) { } catch (EamDbException ex) {
Exceptions.printStackTrace(ex); LOGGER.log(Level.WARNING, "Error loading data", ex);
} }
correlationTypes.forEach((aType) -> { correlationTypes.forEach((aType) -> {

View File

@ -78,7 +78,7 @@ public final class ManageOrganizationsDialog extends JDialog {
setButtonsEnabled(organizationList.getSelectedValue()); setButtonsEnabled(organizationList.getSelectedValue());
newOrg = null; newOrg = null;
} catch (EamDbException ex) { } catch (EamDbException ex) {
Exceptions.printStackTrace(ex); logger.log(Level.WARNING, "Error getting Central Repo for Organizations dialog", ex);
} }
display(); display();
} }

View File

@ -27,10 +27,11 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Observable; import java.util.Observable;
import java.util.Observer; import java.util.Observer;
import java.util.logging.Level;
import javax.swing.ComboBoxModel; import javax.swing.ComboBoxModel;
import org.openide.util.Exceptions;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance; import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
import org.sleuthkit.autopsy.coreutils.Logger;
/** /**
* UI controls for Common Files Search scenario where the user intends to find * UI controls for Common Files Search scenario where the user intends to find
@ -38,6 +39,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
*/ */
public final class InterCasePanel extends javax.swing.JPanel { public final class InterCasePanel extends javax.swing.JPanel {
private final static Logger logger = Logger.getLogger(InterCasePanel.class.getName());
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private final Observable fileTypeFilterObservable; private final Observable fileTypeFilterObservable;
static final int NO_CASE_SELECTED = -1; static final int NO_CASE_SELECTED = -1;
@ -121,7 +123,7 @@ public final class InterCasePanel extends javax.swing.JPanel {
this.correlationTypeComboBox.addItem(type.getDisplayName()); this.correlationTypeComboBox.addItem(type.getDisplayName());
} }
} catch (EamDbException ex) { } catch (EamDbException ex) {
Exceptions.printStackTrace(ex); logger.log(Level.WARNING, "Error getting correlation types", ex);
} }
this.correlationTypeComboBox.setSelectedIndex(0); this.correlationTypeComboBox.setSelectedIndex(0);
} }

View File

@ -397,7 +397,7 @@ public class MessageViewer extends JPanel implements RelationshipsViewer {
try { try {
rootTablePane.getExplorerManager().setSelectedNodes(new Node[0]); rootTablePane.getExplorerManager().setSelectedNodes(new Node[0]);
} catch (PropertyVetoException ex) { } catch (PropertyVetoException ex) {
Exceptions.printStackTrace(ex); logger.log(Level.WARNING, "Error setting selected nodes", ex);
} }
showThreadsPane(); showThreadsPane();
}//GEN-LAST:event_backButtonActionPerformed }//GEN-LAST:event_backButtonActionPerformed

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-18 Basis Technology Corp. * Copyright 2011-19 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -47,7 +47,6 @@ import org.openide.nodes.AbstractNode;
import org.openide.nodes.Children; import org.openide.nodes.Children;
import org.openide.nodes.FilterNode; import org.openide.nodes.FilterNode;
import org.openide.nodes.Node; import org.openide.nodes.Node;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.openide.util.lookup.Lookups; import org.openide.util.lookup.Lookups;
import org.sleuthkit.autopsy.corecomponents.ResultViewerPersistence.SortCriterion; import org.sleuthkit.autopsy.corecomponents.ResultViewerPersistence.SortCriterion;
@ -197,7 +196,7 @@ class ThumbnailViewChildren extends Children.Keys<Integer> {
} }
} catch (IllegalAccessException | InvocationTargetException ex) { } catch (IllegalAccessException | InvocationTargetException ex) {
Exceptions.printStackTrace(ex); logger.log(Level.WARNING, "Error getting value for thumbnail children", ex);
} }
} }
} }

View File

@ -24,9 +24,11 @@ import java.nio.file.Files;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.logging.Level;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.openide.util.Exceptions; import org.openide.util.Exceptions;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.autopsy.coreutils.PlatformUtil;
@ -40,7 +42,7 @@ public final class IngestProfiles {
private static final String PROFILE_DESC_KEY = "Profile_Description"; private static final String PROFILE_DESC_KEY = "Profile_Description";
private static final String PROFILE_FILTER_KEY = "Profile_Filter"; private static final String PROFILE_FILTER_KEY = "Profile_Filter";
private static final String PROFILE_FILE_EXT = ".properties"; private static final String PROFILE_FILE_EXT = ".properties";
private static final Logger logger = Logger.getLogger(IngestProfiles.class.getName());
/** /**
* Gets the collection of profiles which currently exist. * Gets the collection of profiles which currently exist.
* *
@ -143,7 +145,7 @@ public final class IngestProfiles {
Files.deleteIfExists(Paths.get(PlatformUtil.getUserConfigDirectory(), selectedProfile.getName() + PROFILE_FILE_EXT)); Files.deleteIfExists(Paths.get(PlatformUtil.getUserConfigDirectory(), selectedProfile.getName() + PROFILE_FILE_EXT));
FileUtils.deleteDirectory(IngestJobSettings.getSavedModuleSettingsFolder(selectedProfile.getName() + File.separator).toFile()); FileUtils.deleteDirectory(IngestJobSettings.getSavedModuleSettingsFolder(selectedProfile.getName() + File.separator).toFile());
} catch (IOException ex) { } catch (IOException ex) {
Exceptions.printStackTrace(ex); logger.log(Level.WARNING, "Error deleting directory for profile " + selectedProfile.getName(), ex);
} }
} }

View File

@ -128,7 +128,7 @@ final class InterestingArtifactCreatorIngestModule extends FileIngestModuleAdapt
logger.log(Level.SEVERE, String.format("Failed to process file (obj_id = %d)", file.getId()), ex); logger.log(Level.SEVERE, String.format("Failed to process file (obj_id = %d)", file.getId()), ex);
return ProcessResult.ERROR; return ProcessResult.ERROR;
} catch (Blackboard.BlackboardException ex) { } catch (Blackboard.BlackboardException ex) {
Exceptions.printStackTrace(ex); logger.log(Level.WARNING, "Blackboard Exception processing file with obj_id = ", ex);
} }
return ProcessResult.OK; return ProcessResult.OK;
} }

View File

@ -454,7 +454,6 @@ final class StringsTextExtractor implements TextExtractor {
convertBuffRemain = bytesInConvertBuff - convertBuffOffset; convertBuffRemain = bytesInConvertBuff - convertBuffOffset;
} }
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
//Exceptions.printStackTrace(ex);
fileEOF = true; fileEOF = true;
} }
} }

View File

@ -658,7 +658,7 @@ public class GroupManager {
updateCurrentPathGroup(pathGroupKey); updateCurrentPathGroup(pathGroupKey);
} catch (TskCoreException | TskDataException ex) { } catch (TskCoreException | TskDataException ex) {
Exceptions.printStackTrace(ex); logger.log(Level.WARNING, "Error getting drawabledb for fileId " + fileId, ex);
} }
// Update all the groups that this file belongs to // Update all the groups that this file belongs to
@ -986,7 +986,7 @@ public class GroupManager {
.findAny().ifPresent(obj_id -> types.add(mimeType)); .findAny().ifPresent(obj_id -> types.add(mimeType));
} }
} catch (SQLException | TskCoreException ex) { } catch (SQLException | TskCoreException ex) {
Exceptions.printStackTrace(ex); logger.log(Level.WARNING, "Error getting group by MIME type", ex);
} }
results.putAll(null, types); results.putAll(null, types);

View File

@ -174,7 +174,6 @@ public class SortChooser<X, Y extends Comparator<X>> extends HBox {
Image icon = (Image) item.getClass().getMethod("getIcon").invoke(item); Image icon = (Image) item.getClass().getMethod("getIcon").invoke(item);
setGraphic(new ImageView(icon)); setGraphic(new ImageView(icon));
} catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
// Exceptions.printStackTrace(ex);
setText(item.toString()); setText(item.toString());
setGraphic(null); setGraphic(null);
} }