1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-03 22:39:56 +00:00

Merge pull request #3831 from dgrove727/3655_SupressPmdErrorsInUiCode_2

3655 supress pmd errors in ui code 2
This commit is contained in:
Richard Cordovano
2018-06-11 12:56:40 -04:00
committed by GitHub
21 changed files with 44 additions and 35 deletions

View File

@@ -19,8 +19,6 @@
package org.sleuthkit.autopsy.casemodule.services;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
@@ -34,6 +32,7 @@ import org.sleuthkit.datamodel.TskData;
@Messages({"TagNameDialog.descriptionLabel.text=Description:",
"TagNameDialog.notableCheckbox.text=Tag indicates item is notable."})
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
final class TagNameDialog extends javax.swing.JDialog {
private static final long serialVersionUID = 1L;

View File

@@ -47,9 +47,9 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.PostgresEamDbSettings;
import org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings;
/**
*
* @author nick
* Configuration dialog for Central Repository database settings.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
public class EamDbSettingsDialog extends JDialog {
private static final Logger logger = Logger.getLogger(EamDbSettingsDialog.class.getName());
@@ -96,11 +96,8 @@ public class EamDbSettingsDialog extends JDialog {
public boolean accept(File pathname) {
if (pathname.isDirectory()) {
return true;
} else if (pathname.getName().toLowerCase().equals((CENTRAL_REPO_DB_NAME + CENTRAL_REPO_SQLITE_EXT).toLowerCase())) {
return true;
} else {
return false;
}
return pathname.getName().toLowerCase().equals((CENTRAL_REPO_DB_NAME + CENTRAL_REPO_SQLITE_EXT).toLowerCase());
}
@Override

View File

@@ -37,6 +37,10 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamOrganization;
import org.sleuthkit.autopsy.coreutils.Logger;
/**
* Configuration dialog to manage organizations for the Central Repository.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
public final class ManageOrganizationsDialog extends JDialog {
private static final long serialVersionUID = 1L;

View File

@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-17 Basis Technology Corp.
* Copyright 2011-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -32,6 +32,7 @@ import org.sleuthkit.autopsy.corecomponents.ResultViewerPersistence.SortCriterio
/**
* A Gui for choosing a SortCriterion from a list of available properties.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
final class CriterionChooser extends javax.swing.JPanel {
private DefaultListCellRenderer defaultListCellRenderer = new DefaultListCellRenderer();

View File

@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2017 Basis Technology Corp.
* Copyright 2011-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -56,7 +56,6 @@ final class RemoteEventPublisher {
private final MessageProducer producer;
@GuardedBy("this")
private final MessageConsumer consumer;
private final MessageReceiver receiver;
/**
* Constructs an object for publishing events to registered subscribers on
@@ -84,7 +83,7 @@ final class RemoteEventPublisher {
producer = session.createProducer(topic);
producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
consumer = session.createConsumer(topic, "events = '" + ALL_MESSAGE_SELECTOR + "'", true); //NON-NLS
receiver = new MessageReceiver();
MessageReceiver receiver = new MessageReceiver();
consumer.setMessageListener(receiver);
} catch (URISyntaxException | JMSException ex) {
logger.log(Level.SEVERE, "Failed to connect to event channel", ex); //NON-NLS

View File

@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2014 Basis Technology Corp.
* Copyright 2014-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -33,6 +33,7 @@ import org.openide.util.NbBundle;
/**
* A panel that displays ingest task progress snapshots.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
class IngestProgressSnapshotPanel extends javax.swing.JPanel {
private final JDialog parent;

View File

@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2017 Basis Technology Corp.
* Copyright 2011-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,6 +35,10 @@ import org.sleuthkit.autopsy.ingest.IngestProfiles.IngestProfile;
import org.sleuthkit.autopsy.modules.interestingitems.FilesSet;
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetsManager;
/**
* Panel for managing ingest module profiles.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
class ProfileSettingsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel {
@NbBundle.Messages({"ProfileSettingsPanel.title=Profile Settings",

View File

@@ -40,6 +40,7 @@ import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
* Container panel for File Extension Mismatch Ingest Module advanced
* configuration options
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel {
private static final Logger logger = Logger.getLogger(FileExtMismatchSettingsPanel.class.getName());

View File

@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2017 Basis Technology Corp.
* Copyright 2011-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,7 +20,6 @@ package org.sleuthkit.autopsy.modules.filetypeid;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
@@ -39,6 +38,7 @@ import org.openide.windows.WindowManager;
/**
* Dialog used for editing or adding file types.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
class AddFileTypeDialog extends JDialog {
/**
@@ -52,7 +52,7 @@ class AddFileTypeDialog extends JDialog {
private static final long serialVersionUID = 1L;
private FileType fileType;
private AddFileTypePanel addMimeTypePanel;
final private AddFileTypePanel addMimeTypePanel;
private BUTTON_PRESSED result;
private JButton okButton;
private JButton closeButton;

View File

@@ -43,6 +43,7 @@ import org.sleuthkit.autopsy.modules.filetypeid.FileType.Signature;
* being an ingest module global settings panel, an instance of this class also
* appears in the NetBeans options dialog as an options panel.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel {
private static final long serialVersionUID = 1L;
private static final Logger logger = Logger.getLogger(FileTypeIdGlobalSettingsPanel.class.getName());

View File

@@ -47,9 +47,10 @@ import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
* add it to the set of hash databases used to classify files as unknown, known,
* or notable.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
private JFileChooser fileChooser = new JFileChooser();
private final JFileChooser fileChooser;
private String selectedFilePath = "";
private HashDb selectedHashDb = null;
private final static String LAST_FILE_PATH_KEY = "HashDbImport_Path";
@@ -65,6 +66,7 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
super((JFrame) WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(HashDbImportDatabaseDialog.class, "HashDbImportDatabaseDialog.importHashDbMsg"),
true);
this.fileChooser = new JFileChooser();
initComponents();
enableComponents();
initFileChooser();

View File

@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 Basis Technology Corp.
* Copyright 2011-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -45,6 +45,7 @@ import org.sleuthkit.datamodel.TskData;
/**
* Imports a hash set into the central repository and updates a progress dialog
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements PropertyChangeListener {
private CentralRepoImportWorker worker; // Swing worker that will import the file and send updates to the dialog

View File

@@ -49,6 +49,7 @@ import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
/**
* A panel that allows a user to make interesting item definitions.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel {
private static final long serialVersionUID = 1L;

View File

@@ -66,7 +66,6 @@ public class SaveSnapshotAsReport extends Action {
private static final ButtonType OPEN = new ButtonType(Bundle.OpenReportAction_DisplayName(), ButtonBar.ButtonData.NO);
private static final ButtonType OK = new ButtonType(ButtonType.OK.getText(), ButtonBar.ButtonData.CANCEL_CLOSE);
private final TimeLineController controller;
private final Case currentCase;
/**
@@ -96,7 +95,6 @@ public class SaveSnapshotAsReport extends Action {
setLongText(Bundle.SaveSnapShotAsReport_action_longText());
setGraphic(new ImageView(SNAP_SHOT));
this.controller = controller;
this.currentCase = controller.getAutopsyCase();
setEventHandler(actionEvent -> {

View File

@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2015 Basis Technology Corp.
* Copyright 2015-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,8 +20,6 @@ package org.sleuthkit.autopsy.timeline.filters;
import java.util.Objects;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TagName;
/**
@@ -31,13 +29,9 @@ public class TagNameFilter extends AbstractFilter {
private final TagName tagName;
private final Case autoCase;
private final TagsManager tagsManager;
private final SleuthkitCase sleuthkitCase;
public TagNameFilter(TagName tagName, Case autoCase) {
this.autoCase = autoCase;
sleuthkitCase = autoCase.getSleuthkitCase();
tagsManager = autoCase.getServices().getTagsManager();
this.tagName = tagName;
setSelected(Boolean.TRUE);
}

View File

@@ -113,6 +113,7 @@ import org.sleuthkit.autopsy.ingest.IngestProgressSnapshotDialog;
"AutoIngestControlPanel.ConfigLockedTitle=Configuration directory locked",
"AutoIngestControlPanel.PauseDueToSystemError=Paused due to system error, please consult the auto ingest system log"
})
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
public final class AutoIngestControlPanel extends JPanel implements Observer {
private static final long serialVersionUID = 1L;

View File

@@ -33,6 +33,7 @@ import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestMetricsCollector.
/**
* Displays auto ingest metrics for a cluster.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
final class AutoIngestMetricsDialog extends javax.swing.JDialog {
private static final int GIGABYTE_SIZE = 1073741824;

View File

@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2015 Basis Technology Corp.
* Copyright 2015-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,13 +18,14 @@
*/
package org.sleuthkit.autopsy.experimental.configuration;
import java.util.ArrayList;
import java.util.Collection;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComponent;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.core.UserPreferences;
/**
* Configuration panel for advanced settings, such as number of concurrent jobs,
* number of retries, etc.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
class AdvancedAutoIngestSettingsPanel extends javax.swing.JPanel {
private static final long serialVersionUID = 1L;

View File

@@ -43,6 +43,7 @@ import org.sleuthkit.autopsy.ingest.IngestManager;
/**
* A panel to manage all keyword lists created/imported in Autopsy.
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
class GlobalListsManagementPanel extends javax.swing.JPanel implements OptionsPanel {
private static final long serialVersionUID = 1L;

View File

@@ -36,6 +36,7 @@ import org.sleuthkit.autopsy.ingest.IngestManager;
/**
* Child panel of the global settings panel (Languages tab).
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
class KeywordSearchGlobalLanguageSettingsPanel extends javax.swing.JPanel implements OptionsPanel {
private final Map<String, StringExtract.StringExtractUnicodeTable.SCRIPT> scripts = new HashMap<>();

View File

@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2012-2014 Basis Technology Corp.
* Copyright 2012-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,6 +30,7 @@ import org.sleuthkit.autopsy.keywordsearch.KeywordSearchIngestModule.UpdateFrequ
/**
* General, not per list, keyword search configuration and status display widget
*/
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
class KeywordSearchGlobalSearchSettingsPanel extends javax.swing.JPanel implements OptionsPanel {
private final Logger logger = Logger.getLogger(KeywordSearchGlobalSearchSettingsPanel.class.getName());
@@ -360,7 +361,7 @@ class KeywordSearchGlobalSearchSettingsPanel extends javax.swing.JPanel implemen
Object newValue = evt.getNewValue();
if (changed.equals(KeywordSearch.NUM_FILES_CHANGE_EVT)) {
int newFilesIndexed = ((Integer) newValue).intValue();
int newFilesIndexed = ((Integer) newValue);
filesIndexedValue.setText(Integer.toString(newFilesIndexed));
try {
chunksValLabel.setText(Integer.toString(KeywordSearch.getServer().queryNumIndexedChunks()));