mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 00:16:16 +00:00
4792 more string builder codacy adjustments
This commit is contained in:
parent
6c45e32909
commit
1adb0cf1e4
@ -302,8 +302,8 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
|||||||
private void writeOtherOccurrencesToFileAsCSV(File destFile) {
|
private void writeOtherOccurrencesToFileAsCSV(File destFile) {
|
||||||
try (BufferedWriter writer = Files.newBufferedWriter(destFile.toPath())) {
|
try (BufferedWriter writer = Files.newBufferedWriter(destFile.toPath())) {
|
||||||
//write headers
|
//write headers
|
||||||
StringBuilder headers = new StringBuilder("");
|
StringBuilder headers = new StringBuilder("\"");
|
||||||
headers.append('"').append(Bundle.DataContentViewerOtherCasesModel_csvHeader_case())
|
headers.append(Bundle.DataContentViewerOtherCasesModel_csvHeader_case())
|
||||||
.append("\",\"").append(Bundle.DataContentViewerOtherCasesModel_csvHeader_dataSource())
|
.append("\",\"").append(Bundle.DataContentViewerOtherCasesModel_csvHeader_dataSource())
|
||||||
.append("\",\"").append(Bundle.DataContentViewerOtherCasesModel_csvHeader_attribute())
|
.append("\",\"").append(Bundle.DataContentViewerOtherCasesModel_csvHeader_attribute())
|
||||||
.append("\",\"").append(Bundle.DataContentViewerOtherCasesModel_csvHeader_value())
|
.append("\",\"").append(Bundle.DataContentViewerOtherCasesModel_csvHeader_value())
|
||||||
@ -1097,7 +1097,7 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
|||||||
if (EamDb.isEnabled() && filesTable.getSelectedRowCount() == 1) {
|
if (EamDb.isEnabled() && filesTable.getSelectedRowCount() == 1) {
|
||||||
int rowIndex = filesTable.getSelectedRow();
|
int rowIndex = filesTable.getSelectedRow();
|
||||||
List<OtherOccurrenceNodeData> selectedFile = filesTableModel.getListOfNodesForFile(rowIndex);
|
List<OtherOccurrenceNodeData> selectedFile = filesTableModel.getListOfNodesForFile(rowIndex);
|
||||||
if (selectedFile.get(0) instanceof OtherOccurrenceNodeInstanceData) {
|
if (!selectedFile.isEmpty() && selectedFile.get(0) instanceof OtherOccurrenceNodeInstanceData) {
|
||||||
OtherOccurrenceNodeInstanceData instanceData = (OtherOccurrenceNodeInstanceData) selectedFile.get(0);
|
OtherOccurrenceNodeInstanceData instanceData = (OtherOccurrenceNodeInstanceData) selectedFile.get(0);
|
||||||
enableCentralRepoActions = instanceData.isCentralRepoNode();
|
enableCentralRepoActions = instanceData.isCentralRepoNode();
|
||||||
}
|
}
|
||||||
|
@ -239,8 +239,8 @@ class OtherOccurrenceNodeInstanceData implements OtherOccurrenceNodeData {
|
|||||||
* @return a comma separated string representation of the node's data
|
* @return a comma separated string representation of the node's data
|
||||||
*/
|
*/
|
||||||
String toCsvString() {
|
String toCsvString() {
|
||||||
StringBuilder line = new StringBuilder("");
|
StringBuilder line = new StringBuilder("\"");
|
||||||
line.append('"').append(getCaseName()).append("\",\"")
|
line.append(getCaseName()).append("\",\"")
|
||||||
.append(getDataSourceName()).append("\",\"")
|
.append(getDataSourceName()).append("\",\"")
|
||||||
.append(getType()).append("\",\"")
|
.append(getType()).append("\",\"")
|
||||||
.append(getValue()).append("\",\"")
|
.append(getValue()).append("\",\"")
|
||||||
|
@ -62,9 +62,10 @@ public class OtherOccurrencesFilesTableModel extends AbstractTableModel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getValueAt(int rowIdx, int colIdx) {
|
public Object getValueAt(int rowIdx, int colIdx) {
|
||||||
if (nodeKeys.isEmpty()) {
|
if (nodeKeys.isEmpty() || nodeMap.get(nodeKeys.get(rowIdx)).isEmpty()) {
|
||||||
return Bundle.OtherOccurrencesFilesTableModel_noData();
|
return Bundle.OtherOccurrencesFilesTableModel_noData();
|
||||||
}
|
}
|
||||||
|
|
||||||
return FilenameUtils.getName(((OtherOccurrenceNodeInstanceData) nodeMap.get(nodeKeys.get(rowIdx)).get(0)).getFilePath());
|
return FilenameUtils.getName(((OtherOccurrenceNodeInstanceData) nodeMap.get(nodeKeys.get(rowIdx)).get(0)).getFilePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user