mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +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) {
|
||||
try (BufferedWriter writer = Files.newBufferedWriter(destFile.toPath())) {
|
||||
//write headers
|
||||
StringBuilder headers = new StringBuilder("");
|
||||
headers.append('"').append(Bundle.DataContentViewerOtherCasesModel_csvHeader_case())
|
||||
StringBuilder headers = new StringBuilder("\"");
|
||||
headers.append(Bundle.DataContentViewerOtherCasesModel_csvHeader_case())
|
||||
.append("\",\"").append(Bundle.DataContentViewerOtherCasesModel_csvHeader_dataSource())
|
||||
.append("\",\"").append(Bundle.DataContentViewerOtherCasesModel_csvHeader_attribute())
|
||||
.append("\",\"").append(Bundle.DataContentViewerOtherCasesModel_csvHeader_value())
|
||||
@ -1097,7 +1097,7 @@ public class DataContentViewerOtherCases extends JPanel implements DataContentVi
|
||||
if (EamDb.isEnabled() && filesTable.getSelectedRowCount() == 1) {
|
||||
int rowIndex = filesTable.getSelectedRow();
|
||||
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);
|
||||
enableCentralRepoActions = instanceData.isCentralRepoNode();
|
||||
}
|
||||
|
@ -239,8 +239,8 @@ class OtherOccurrenceNodeInstanceData implements OtherOccurrenceNodeData {
|
||||
* @return a comma separated string representation of the node's data
|
||||
*/
|
||||
String toCsvString() {
|
||||
StringBuilder line = new StringBuilder("");
|
||||
line.append('"').append(getCaseName()).append("\",\"")
|
||||
StringBuilder line = new StringBuilder("\"");
|
||||
line.append(getCaseName()).append("\",\"")
|
||||
.append(getDataSourceName()).append("\",\"")
|
||||
.append(getType()).append("\",\"")
|
||||
.append(getValue()).append("\",\"")
|
||||
|
@ -62,9 +62,10 @@ public class OtherOccurrencesFilesTableModel extends AbstractTableModel {
|
||||
|
||||
@Override
|
||||
public Object getValueAt(int rowIdx, int colIdx) {
|
||||
if (nodeKeys.isEmpty()) {
|
||||
if (nodeKeys.isEmpty() || nodeMap.get(nodeKeys.get(rowIdx)).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