mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 07:56:16 +00:00
4792 first batch of codacy fixes
This commit is contained in:
parent
1301920a4a
commit
a6af2924c6
@ -238,8 +238,8 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
EamDb dbManager = EamDb.getInstance();
|
||||
int selectedRowModelIdx = filesTable.convertRowIndexToModel(selectedRowViewIdx);
|
||||
List<OtherOccurrenceNodeData> rowList = filesTableModel.getListOfNodesForFile(selectedRowModelIdx);
|
||||
if (rowList.get(0) instanceof OtherOccurrenceNodeInstanceData) {
|
||||
if (!rowList.isEmpty()) {
|
||||
if (!rowList.isEmpty()) {
|
||||
if (rowList.get(0) instanceof OtherOccurrenceNodeInstanceData) {
|
||||
CorrelationCase eamCasePartial = ((OtherOccurrenceNodeInstanceData) rowList.get(0)).getCorrelationAttributeInstance().getCorrelationCase();
|
||||
caseDisplayName = eamCasePartial.getDisplayName();
|
||||
// query case details
|
||||
@ -250,10 +250,10 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
details = Bundle.DataContentViewerOtherCases_caseDetailsDialog_noDetails();
|
||||
}
|
||||
} else {
|
||||
details = Bundle.DataContentViewerOtherCases_caseDetailsDialog_noDetailsReference();
|
||||
details = Bundle.DataContentViewerOtherCases_caseDetailsDialog_notSelected();
|
||||
}
|
||||
} else {
|
||||
details = Bundle.DataContentViewerOtherCases_caseDetailsDialog_notSelected();
|
||||
details = Bundle.DataContentViewerOtherCases_caseDetailsDialog_noDetailsReference();
|
||||
}
|
||||
}
|
||||
} catch (EamDbException ex) {
|
||||
@ -303,13 +303,13 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
try (BufferedWriter writer = Files.newBufferedWriter(destFile.toPath())) {
|
||||
//write headers
|
||||
StringBuilder headers = new StringBuilder("");
|
||||
headers.append('"').append(Bundle.DataContentViewerOtherCasesModel_csvHeader_case()).append('"').append(',');
|
||||
headers.append('"').append(Bundle.DataContentViewerOtherCasesModel_csvHeader_dataSource()).append('"').append(',');
|
||||
headers.append('"').append(Bundle.DataContentViewerOtherCasesModel_csvHeader_attribute()).append('"').append(',');
|
||||
headers.append('"').append(Bundle.DataContentViewerOtherCasesModel_csvHeader_value()).append('"').append(',');
|
||||
headers.append('"').append(Bundle.DataContentViewerOtherCasesModel_csvHeader_known()).append('"').append(',');
|
||||
headers.append('"').append(Bundle.DataContentViewerOtherCasesModel_csvHeader_path()).append('"').append(',');
|
||||
headers.append('"').append(Bundle.DataContentViewerOtherCasesModel_csvHeader_comment()).append('"').append(System.getProperty("line.separator"));
|
||||
headers.append('"').append(Bundle.DataContentViewerOtherCasesModel_csvHeader_case()).append("\",\"");
|
||||
headers.append(Bundle.DataContentViewerOtherCasesModel_csvHeader_dataSource()).append("\",\"");
|
||||
headers.append(Bundle.DataContentViewerOtherCasesModel_csvHeader_attribute()).append("\",\"");
|
||||
headers.append(Bundle.DataContentViewerOtherCasesModel_csvHeader_value()).append("\",\"");
|
||||
headers.append(Bundle.DataContentViewerOtherCasesModel_csvHeader_known()).append("\",\"");
|
||||
headers.append(Bundle.DataContentViewerOtherCasesModel_csvHeader_path()).append("\",\"");
|
||||
headers.append(Bundle.DataContentViewerOtherCasesModel_csvHeader_comment()).append("\"").append(System.getProperty("line.separator"));
|
||||
writer.write(headers.toString());
|
||||
//write content
|
||||
for (CorrelationAttributeInstance corAttr : correlationAttributes) {
|
||||
|
@ -240,13 +240,13 @@ class OtherOccurrenceNodeInstanceData implements OtherOccurrenceNodeData {
|
||||
*/
|
||||
String toCsvString() {
|
||||
StringBuilder line = new StringBuilder("");
|
||||
line.append('"').append(getCaseName()).append('"').append(',');
|
||||
line.append('"').append(getDataSourceName()).append('"').append(',');
|
||||
line.append('"').append(getType()).append('"').append(',');
|
||||
line.append('"').append(getValue()).append('"').append(',');
|
||||
line.append('"').append(getKnown().toString()).append('"').append(',');
|
||||
line.append('"').append(getFilePath()).append('"').append(',');
|
||||
line.append('"').append(getComment()).append('"').append(System.getProperty("line.separator"));
|
||||
line.append('"').append(getCaseName()).append("\",\"");
|
||||
line.append(getDataSourceName()).append("\",\"");
|
||||
line.append(getType()).append("\",\"");
|
||||
line.append(getValue()).append("\",\"");
|
||||
line.append(getKnown().toString()).append("\",\"");
|
||||
line.append(getFilePath()).append("\",\"");
|
||||
line.append(getComment()).append("\"").append(System.getProperty("line.separator"));
|
||||
return line.toString();
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class OtherOccurrencesCasesTableModel extends AbstractTableModel {
|
||||
@Messages({"OtherOccurrencesCasesTableModel.noData=No Data."})
|
||||
@Override
|
||||
public Object getValueAt(int rowIdx, int colIdx) {
|
||||
if (0 == correlationCaseList.size()) {
|
||||
if (correlationCaseList.isEmpty()) {
|
||||
return Bundle.OtherOccurrencesCasesTableModel_noData();
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.centralrepository.contentviewer;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
import org.openide.util.NbBundle;
|
||||
|
||||
@ -30,7 +31,7 @@ import org.openide.util.NbBundle;
|
||||
final class OtherOccurrencesDataSourcesTableModel extends AbstractTableModel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final LinkedHashSet<DataSourceColumnItem> dataSourceSet = new LinkedHashSet<>();
|
||||
private final Set<DataSourceColumnItem> dataSourceSet = new LinkedHashSet<>();
|
||||
|
||||
/**
|
||||
* Create a table model for displaying data source names
|
||||
@ -58,7 +59,7 @@ final class OtherOccurrencesDataSourcesTableModel extends AbstractTableModel {
|
||||
|
||||
@Override
|
||||
public Object getValueAt(int rowIdx, int colIdx) {
|
||||
if (0 == dataSourceSet.size()) {
|
||||
if (dataSourceSet.isEmpty()) {
|
||||
return Bundle.OtherOccurrencesDataSourcesTableModel_noData();
|
||||
}
|
||||
return ((DataSourceColumnItem) dataSourceSet.toArray()[rowIdx]).getDataSourceName();
|
||||
|
@ -62,7 +62,7 @@ public class OtherOccurrencesFilesTableModel extends AbstractTableModel {
|
||||
|
||||
@Override
|
||||
public Object getValueAt(int rowIdx, int colIdx) {
|
||||
if (0 == nodeKeys.size()) {
|
||||
if (nodeKeys.isEmpty()) {
|
||||
return Bundle.OtherOccurrencesFilesTableModel_noData();
|
||||
}
|
||||
return FilenameUtils.getName(((OtherOccurrenceNodeInstanceData) nodeMap.get(nodeKeys.get(rowIdx)).get(0)).getFilePath());
|
||||
|
Loading…
x
Reference in New Issue
Block a user