[dumpCSV] remove not needed code

This commit is contained in:
Miriam Baglioni 2023-07-17 16:28:46 +02:00
parent 0482648131
commit 2566b97138
1 changed files with 5 additions and 11 deletions

View File

@ -150,9 +150,9 @@ public class SparkDumpResults implements Serializable {
ar.setRank(String.valueOf(count));
}
}
ar.setFirstName(replace(a.getName()));
ar.setLastName(replace(a.getSurname()));
ar.setFullName(replace(a.getFullname()));
ar.setFirstName(removeBreaks(a.getName()));
ar.setLastName(removeBreaks(a.getSurname()));
ar.setFullName(removeBreaks(a.getFullname()));
Tuple2<String, Boolean> orcid = getOrcid(a.getPid());
if (Optional.ofNullable(orcid).isPresent()) {
ar.setOrcid(orcid._1());
@ -217,13 +217,6 @@ public class SparkDumpResults implements Serializable {
}
private static String replace(String input) {
if (Optional.ofNullable(input).isPresent())
return input.replace("\t", " ").replace("\n", " ").replace("\r", " ").replace("\"", " ");
else
return "";
}
private static List<CSVPid> mapPid(List<StructuredProperty> pid, String resultId) {
return pid
.stream()
@ -354,7 +347,8 @@ public class SparkDumpResults implements Serializable {
}
private static String removeBreaks(String input) {
return input.replace("\n", " ").replace("\t", " ")
return input.replace("\n", " ")
.replace("\t", " ")
.replace("\r", " ")
.replace("\\\"", " ")
.replace("\"", " ")