Source:
<code>private void writeOtherOccurrencesToFileAsCSV(File destFile) { try (BufferedWriter writer = Files.newBufferedWriter(destFile.toPath())) { StringBuilder headers = new StringBuilder(""); <START> headers.append('"').append(Bundle.DataContentViewerOtherCasesModel_csvHeader_case()).append('"').append(','); <END> 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")); writer.write(headers.toString()); for (CorrelationAttributeInstance corAttr : correlationAttributes) { Map<UniquePathKey, OtherOccurrenceNodeInstanceData> correlatedNodeDataMap = new HashMap<>(0); correlatedNodeDataMap.putAll(getCorrelatedInstances(corAttr, dataSourceName, deviceId)); for (OtherOccurrenceNodeInstanceData nodeData : correlatedNodeDataMap.values()) { writer.write(nodeData.toCsvString()); } } } catch (IOException ex) { LOGGER.log(Level.SEVERE, "Error writing selected rows to CSV.", ex); } }</code><technical_language>Codacy a lot of issues StringBuilder is here</technical_language>

Target:
private void writeOtherOccurrencesToFileAsCSV(File destFile) { try (BufferedWriter writer = Files.newBufferedWriter(destFile.toPath())) { StringBuilder headers = new StringBuilder("\""); headers.append(Bundle.DataContentViewerOtherCasesModel_csvHeader_case()) .append(OtherOccurrenceNodeInstanceData.getCsvItemSeparator()).append(Bundle.DataContentViewerOtherCasesModel_csvHeader_dataSource()) .append(OtherOccurrenceNodeInstanceData.getCsvItemSeparator()).append(Bundle.DataContentViewerOtherCasesModel_csvHeader_attribute()) .append(OtherOccurrenceNodeInstanceData.getCsvItemSeparator()).append(Bundle.DataContentViewerOtherCasesModel_csvHeader_value()) .append(OtherOccurrenceNodeInstanceData.getCsvItemSeparator()).append(Bundle.DataContentViewerOtherCasesModel_csvHeader_known()) .append(OtherOccurrenceNodeInstanceData.getCsvItemSeparator()).append(Bundle.DataContentViewerOtherCasesModel_csvHeader_path()) .append(OtherOccurrenceNodeInstanceData.getCsvItemSeparator()).append(Bundle.DataContentViewerOtherCasesModel_csvHeader_comment()) .append('"').append(System.getProperty("line.separator")); writer.write(headers.toString()); for (CorrelationAttributeInstance corAttr : correlationAttributes) { Map<UniquePathKey, OtherOccurrenceNodeInstanceData> correlatedNodeDataMap = new HashMap<>(0); correlatedNodeDataMap.putAll(getCorrelatedInstances(corAttr, dataSourceName, deviceId)); for (OtherOccurrenceNodeInstanceData nodeData : correlatedNodeDataMap.values()) { writer.write(nodeData.toCsvString()); } } } catch (IOException ex) { LOGGER.log(Level.SEVERE, "Error writing selected rows to CSV.", ex); } }