diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index b8542552c4..252a44e577 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,6 +32,7 @@ import org.openide.windows.WindowManager; * Panel for displaying the case information, including both case details and * ingest job history. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives class CaseInformationPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java index 478820353f..3ddb97fcfd 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java @@ -35,6 +35,7 @@ import org.openide.windows.WindowManager; /* * The panel in the default Autopsy startup window. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives public class CueBannerPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/EditOptionalCasePropertiesPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/EditOptionalCasePropertiesPanel.java index d1c726d3eb..907c2fd0f6 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/EditOptionalCasePropertiesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/EditOptionalCasePropertiesPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,9 +22,9 @@ import java.awt.event.ActionListener; import org.openide.util.NbBundle.Messages; /** - * - * @author wschaefer + * Panel to allow examiner to edit option case properties. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives class EditOptionalCasePropertiesPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java index 56d5e67839..1d2b1ce1e2 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java @@ -31,7 +31,6 @@ import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.filechooser.FileFilter; import org.apache.commons.lang3.StringUtils; -import org.openide.util.Exceptions; import org.openide.util.NbBundle; import static org.sleuthkit.autopsy.casemodule.Bundle.*; import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor; @@ -46,6 +45,7 @@ import org.sleuthkit.autopsy.coreutils.PathValidator; * to select a file as well as choose the timezone and whether to ignore orphan * files in FAT32. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives public class ImageFilePanel extends JPanel implements DocumentListener { private static final Logger logger = Logger.getLogger(ImageFilePanel.class.getName()); diff --git a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java index 266c0d91f2..81ffcb4805 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2017-18 Basis Technology Corp. + * Copyright 2017-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -57,6 +57,7 @@ import org.sleuthkit.datamodel.TskCoreException; * Panel that holds the Filter control widgets and triggers queries against the * CommunicationsManager on user filtering changes. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives final public class FiltersPanel extends JPanel { private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/FXVideoPanel.java b/Core/src/org/sleuthkit/autopsy/contentviewers/FXVideoPanel.java index cc5e2008b5..07736120c7 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/FXVideoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/FXVideoPanel.java @@ -76,6 +76,7 @@ import org.sleuthkit.datamodel.TskData; @ServiceProviders(value = { @ServiceProvider(service = FrameCapture.class) }) +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives public class FXVideoPanel extends MediaViewVideoPanel { // Refer to https://docs.oracle.com/javafx/2/api/javafx/scene/media/package-summary.html diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentPanel.java index 9b94c9a7b5..642ba5f4b0 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2014 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -38,8 +38,9 @@ import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.TskCoreException; /** - * + * Data content panel. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives public class DataContentPanel extends javax.swing.JPanel implements DataContent, ChangeListener { private static Logger logger = Logger.getLogger(DataContentPanel.class.getName()); @@ -241,7 +242,7 @@ public class DataContentPanel extends javax.swing.JPanel implements DataContent, private static class UpdateWrapper { - private DataContentViewer wrapped; + private final DataContentViewer wrapped; private boolean outdated; UpdateWrapper(DataContentViewer wrapped) { diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java index 4aa7a63117..ced154edf7 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java @@ -72,6 +72,7 @@ import org.sleuthkit.autopsy.datamodel.NodeSelectionInfo; * (DataContentTopComponent) that is normally docked into the lower right hand * side of the main application window, or it could be a custom content view. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives public class DataResultPanel extends javax.swing.JPanel implements DataResult, ChangeListener, ExplorerManager.Provider { private static final long serialVersionUID = 1L; @@ -451,7 +452,7 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C } } } - }; + } if (tabToSelect == NO_TAB_SELECTED) { tabToSelect = resultViewerTabs.getSelectedIndex(); if ((tabToSelect == NO_TAB_SELECTED) || (!resultViewerTabs.isEnabledAt(tabToSelect))) { diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/FileSystemDetailsPanel.java b/Core/src/org/sleuthkit/autopsy/directorytree/FileSystemDetailsPanel.java index ce5b915b41..29fd7d3bf4 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/FileSystemDetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/FileSystemDetailsPanel.java @@ -27,9 +27,8 @@ import org.sleuthkit.datamodel.TskCoreException; /** * This is the form / panel to show the File System Details. - * - * @author jantonius */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives final class FileSystemDetailsPanel extends javax.swing.JPanel { private static final Logger logger = Logger.getLogger(FileSystemDetailsPanel.class.getName()); private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ImageDetailsPanel.java b/Core/src/org/sleuthkit/autopsy/directorytree/ImageDetailsPanel.java index b551c11c69..e26c0605ab 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ImageDetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ImageDetailsPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,21 +16,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -/* - * ImageDetailsPanel.java - * - * Created on May 2, 2011, 3:53:49 PM - */ package org.sleuthkit.autopsy.directorytree; -import java.awt.*; import java.awt.event.ActionListener; /** - * - * @author jantonius + * Image details panel. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives class ImageDetailsPanel extends javax.swing.JPanel { /** diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java index 0219b76367..c9270a136a 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,12 +16,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - /* - * FileSearchPanel.java - * - * Created on Mar 5, 2012, 1:51:50 PM - */ package org.sleuthkit.autopsy.filesearch; import java.awt.Component; @@ -56,6 +50,7 @@ import org.sleuthkit.datamodel.TskCoreException; /** * FileSearchPanel that present search options */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives class FileSearchPanel extends javax.swing.JPanel { private final List filterAreas = new ArrayList<>(); diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/HashSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/HashSearchPanel.java index 3f0d5176ac..6a5491ea08 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/HashSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/HashSearchPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,8 +27,9 @@ import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; /** - * + * Panel to allow examiner to search for a hash value. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives class HashSearchPanel extends javax.swing.JPanel { private static final long serialVersionUID = 1L; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestCancellationPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestCancellationPanel.java index 2d13e3fadb..318dc6e05a 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestCancellationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/DataSourceIngestCancellationPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2014 Basis Technology Corp. + * Copyright 2014-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,6 +22,7 @@ package org.sleuthkit.autopsy.ingest; * A UI panel that allows a user to make data source ingest cancellation * requests. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives final class DataSourceIngestCancellationPanel extends javax.swing.JPanel { private boolean cancelAllIngestModules; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageMainPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageMainPanel.java index 1fa70462cc..d2dd0c2ad2 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageMainPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageMainPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2013 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,6 +25,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; * the main layered pane container for messages table (IngestMessagePanel) and * details view (IngestMessageDetailsPanel) */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives class IngestMessageMainPanel extends javax.swing.JPanel { private IngestMessagePanel messagePanel; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java index f9063b289c..a8f4d39dea 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2014 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,6 +36,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; +import javax.swing.DefaultComboBoxModel; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTable; @@ -51,14 +52,13 @@ import javax.swing.table.TableCellRenderer; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; -import org.sleuthkit.autopsy.ingest.IngestMessage.*; import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType; import org.sleuthkit.datamodel.BlackboardArtifact; /** * Notification window showing messages from modules to user - * */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives class IngestMessagePanel extends JPanel implements TableModelListener { private final MessageTableModel tableModel; @@ -245,7 +245,7 @@ class IngestMessagePanel extends JPanel implements TableModelListener { * It is not possible to internationalize the list of options in a ComboBox * inside of the generated form code. So, it is done here. */ - sortByComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { + sortByComboBox.setModel(new DefaultComboBoxModel<>(new String[] { NbBundle.getMessage(this.getClass(), "IngestMessagePanel.sortByComboBox.model.time"), NbBundle.getMessage(this.getClass(), "IngestMessagePanel.sortByComboBox.model.priority")})); @@ -519,7 +519,7 @@ class IngestMessagePanel extends JPanel implements TableModelListener { if (moduleName != null && m.getMessageType() == IngestMessage.MessageType.DATA) { //not a manager message, a data message, then group if (!groupings.containsKey(moduleName)) { - groupings.put(moduleName, new HashMap>()); + groupings.put(moduleName, new HashMap<>()); } final Map> groups = groupings.get(moduleName); //groups for this uniqueness @@ -564,7 +564,7 @@ class IngestMessagePanel extends JPanel implements TableModelListener { messageGroup = first; //move to bottom of table //remove from existing position - int toRemove = 0; + int toRemove; while ((toRemove = getTableEntryIndex(uniqueness)) != -1) { messageData.remove(toRemove); //remove the row, will be added to the bottom diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestOptionsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestOptionsPanel.java index 40f3d1c298..cbfd996473 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestOptionsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestOptionsPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,6 +32,7 @@ import org.sleuthkit.autopsy.modules.interestingitems.FilesSetDefsPanel.PANEL_TY /** * Global options panel for keyword searching. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives public class IngestOptionsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel { @NbBundle.Messages({"IngestOptionsPanel.settingsTab.text=Settings", diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbSearchPanel.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbSearchPanel.java index a75b47646e..93ee3ce836 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbSearchPanel.java @@ -38,6 +38,7 @@ import org.sleuthkit.autopsy.ingest.IngestManager; /** * Searches for files by md5 hash, based off the hash given in this panel. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives class HashDbSearchPanel extends javax.swing.JPanel implements ActionListener { private static final Logger logger = Logger.getLogger(HashDbSearchPanel.class.getName()); @@ -329,7 +330,7 @@ class HashDbSearchPanel extends javax.swing.JPanel implements ActionListener { errorField.setVisible(false); // Get all the rows in the table int numRows = hashTable.getRowCount(); - ArrayList hashes = new ArrayList(); + ArrayList hashes = new ArrayList<>(); for (int i = 0; i < numRows; i++) { hashes.add((String) hashTable.getValueAt(i, 0)); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetRulePanel.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetRulePanel.java index 4965652c5f..36888279a9 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetRulePanel.java +++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetRulePanel.java @@ -38,6 +38,7 @@ import org.sleuthkit.autopsy.modules.interestingitems.FilesSetDefsPanel.PANEL_TY /** * A panel that allows a user to create and edit files set membership rules. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives final class FilesSetRulePanel extends javax.swing.JPanel { @Messages({ diff --git a/Core/src/org/sleuthkit/autopsy/report/DefaultReportConfigurationPanel.java b/Core/src/org/sleuthkit/autopsy/report/DefaultReportConfigurationPanel.java index ad1ce529dc..2f18ddf3d2 100644 --- a/Core/src/org/sleuthkit/autopsy/report/DefaultReportConfigurationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/report/DefaultReportConfigurationPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2012 Basis Technology Corp. + * Copyright 2012-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,11 +18,10 @@ */ package org.sleuthkit.autopsy.report; -import java.awt.*; - /** * The panel shown for all TableReportModules when configuring report modules. */ +@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives public class DefaultReportConfigurationPanel extends javax.swing.JPanel { /**