code formatting

This commit is contained in:
Claudio Atzori 2023-07-26 09:14:08 +02:00
parent 59764145bb
commit d512df8612
1 changed files with 31 additions and 24 deletions

View File

@ -292,7 +292,8 @@ public class GraphCleaningFunctions extends CleaningFunctions {
} else if (value instanceof Result) { } else if (value instanceof Result) {
Result r = (Result) value; Result r = (Result) value;
if (Objects.nonNull(r.getFulltext()) && (ModelConstants.SOFTWARE_RESULTTYPE_CLASSID.equals(r.getResulttype().getClassid()) || if (Objects.nonNull(r.getFulltext())
&& (ModelConstants.SOFTWARE_RESULTTYPE_CLASSID.equals(r.getResulttype().getClassid()) ||
ModelConstants.DATASET_RESULTTYPE_CLASSID.equals(r.getResulttype().getClassid()))) { ModelConstants.DATASET_RESULTTYPE_CLASSID.equals(r.getResulttype().getClassid()))) {
r.setFulltext(null); r.setFulltext(null);
@ -326,10 +327,13 @@ public class GraphCleaningFunctions extends CleaningFunctions {
if (StringUtils.isBlank(r.getPublisher().getValue())) { if (StringUtils.isBlank(r.getPublisher().getValue())) {
r.setPublisher(null); r.setPublisher(null);
} else { } else {
r.getPublisher().setValue( r
r.getPublisher().getValue() .getPublisher()
.replaceAll(NAME_CLEANING_REGEX, " ") .setValue(
); r
.getPublisher()
.getValue()
.replaceAll(NAME_CLEANING_REGEX, " "));
} }
} }
if (Objects.isNull(r.getLanguage()) || StringUtils.isBlank(r.getLanguage().getClassid())) { if (Objects.isNull(r.getLanguage()) || StringUtils.isBlank(r.getLanguage().getClassid())) {
@ -623,25 +627,28 @@ public class GraphCleaningFunctions extends CleaningFunctions {
private static Author cleanupAuthor(Author author) { private static Author cleanupAuthor(Author author) {
if (StringUtils.isNotBlank(author.getFullname())) { if (StringUtils.isNotBlank(author.getFullname())) {
author.setFullname( author
author.getFullname() .setFullname(
author
.getFullname()
.replaceAll(NAME_CLEANING_REGEX, " ") .replaceAll(NAME_CLEANING_REGEX, " ")
.replace("\"", "\\\"") .replace("\"", "\\\""));
);
} }
if (StringUtils.isNotBlank(author.getName())) { if (StringUtils.isNotBlank(author.getName())) {
author.setName( author
author.getName() .setName(
author
.getName()
.replaceAll(NAME_CLEANING_REGEX, " ") .replaceAll(NAME_CLEANING_REGEX, " ")
.replace("\"", "\\\"") .replace("\"", "\\\""));
);
} }
if (StringUtils.isNotBlank(author.getSurname())) { if (StringUtils.isNotBlank(author.getSurname())) {
author.setSurname( author
author.getSurname() .setSurname(
author
.getSurname()
.replaceAll(NAME_CLEANING_REGEX, " ") .replaceAll(NAME_CLEANING_REGEX, " ")
.replace("\"", "\\\"") .replace("\"", "\\\""));
);
} }
return author; return author;