From fd1266f81dfc6117f0950c0b98439c3ded393fb7 Mon Sep 17 00:00:00 2001 From: soletsdev Date: Wed, 25 Sep 2024 09:11:48 -0700 Subject: [PATCH] addressesing sonar cloud --- .../main/java/ca/bc/gov/educ/penreg/api/rest/RestUtils.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/src/main/java/ca/bc/gov/educ/penreg/api/rest/RestUtils.java b/api/src/main/java/ca/bc/gov/educ/penreg/api/rest/RestUtils.java index b4f01764..758d1689 100644 --- a/api/src/main/java/ca/bc/gov/educ/penreg/api/rest/RestUtils.java +++ b/api/src/main/java/ca/bc/gov/educ/penreg/api/rest/RestUtils.java @@ -401,12 +401,10 @@ public List getStudentRegistrationContactList(final String mincod throw new PenRegAPIRuntimeException("API call to Institute API received null response when getting student registration contacts, contact the Ministry for more info."); } - List activeStudentRegistrationContacts = schoolContactSearchWrapper.getContent().stream().filter(contact -> { + return schoolContactSearchWrapper.getContent().stream().filter(contact -> { final String expiryDate = contact.getExpiryDate(); return contact.getExpiryDate() == null || (expiryDate != null && LocalDate.parse(expiryDate, DateTimeFormatter.ISO_DATE_TIME).isAfter(LocalDate.now())); }).toList(); - - return activeStudentRegistrationContacts; }catch(Exception e){ log.error("API call to Institute API failure getting student registration contacts :: {}", e.getMessage()); throw new PenRegAPIRuntimeException("API call to Institute API failure getting student registration contacts, contact the Ministry for more info.");