From acbc369d759502129ff4ca36c0ccf2493dae4573 Mon Sep 17 00:00:00 2001 From: Geoffrey Karnbach Date: Mon, 23 Dec 2024 11:00:33 +0100 Subject: [PATCH] Export: Use Objects.equals to perform a null-safe enum check --- .../AbstractTemplateExportScienceEuropeComponents.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/damap/base/conversion/AbstractTemplateExportScienceEuropeComponents.java b/src/main/java/org/damap/base/conversion/AbstractTemplateExportScienceEuropeComponents.java index 176d59be..23f4894b 100644 --- a/src/main/java/org/damap/base/conversion/AbstractTemplateExportScienceEuropeComponents.java +++ b/src/main/java/org/damap/base/conversion/AbstractTemplateExportScienceEuropeComponents.java @@ -224,7 +224,7 @@ private void projectCoordinatorInformation() { if (contributor.getPersonId() != null) { coordinatorIdentifierId = contributor.getPersonId().getIdentifier(); - if (contributor.getPersonId().getType().toString().equals("orcid")) { + if (Objects.equals(contributor.getPersonId().getType(), EIdentifierType.ORCID)) { String coordinatorId = "ORCID iD: " + coordinatorIdentifierId; coordinatorProperties.add(coordinatorId); } @@ -236,7 +236,7 @@ private void projectCoordinatorInformation() { if (contributor.getAffiliationId() != null) { coordinatorAffiliationIdentifierId = contributor.getAffiliationId().getIdentifier(); - if (contributor.getAffiliationId().getType().toString().equals("ror")) { + if (Objects.equals(contributor.getAffiliationId().getType(), EIdentifierType.ROR)) { String coordinatorAffiliationIdentifierType = "ROR: "; String coordinatorAffiliationId = coordinatorAffiliationIdentifierType + coordinatorAffiliationIdentifierId;