Closed sonika-shah closed 1 month ago
@sonika-shah fieldToInternalArray is unnecessarily complex. You can write the same thing like below using CSVParser
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
public static List<String> fieldToExtensionStrings(String field) throws IOException {
if (field == null || field.isBlank()) {
return List.of();
}
CSVFormat format = CSVFormat.DEFAULT
.withDelimiter(';')
.withQuote('"')
.withEscape('"')
.withRecordSeparator(null);
try (CSVParser parser = CSVParser.parse(field, format)) {
List<String> result = new ArrayList<>();
for (CSVRecord record : parser) {
for (String value : record) {
result.add(value);
}
}
return result;
}
}```
Issues
6 New issues
0 Accepted issues
Measures
2 Security Hotspots
0.0% Coverage on New Code
0.5% Duplication on New Code
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Describe your changes:
https://github.com/user-attachments/assets/b4a7add1-d219-496b-9fc4-aa16856e4744
https://github.com/user-attachments/assets/f5751b45-de71-477c-acd8-4c77143f806f
#
Type of change:
#
Checklist:
Fixes <issue-number>: <short explanation>