galovics commented on code in PR #2662:
URL: https://github.com/apache/fineract/pull/2662#discussion_r994473216


##########
fineract-provider/src/main/java/org/apache/fineract/organisation/holiday/service/HolidayReadPlatformServiceImpl.java:
##########
@@ -79,7 +79,8 @@ public HolidayData mapRow(final ResultSet rs, 
@SuppressWarnings("unused") final
             final Integer reschedulingType = JdbcSupport.getInteger(rs, 
"reschedulingType");
             final EnumOptionData status = 
HolidayEnumerations.holidayStatusType(statusEnum);
 
-            return new HolidayData(id, name, description, fromDate, toDate, 
repaymentsScheduleTO, status, reschedulingType);
+            return new 
HolidayData().setId(id).setName(name).setDescription(description).setFromDate(fromDate).setToDate(toDate)

Review Comment:
   I don't see this logic here (especially the trims and stuff)
   ```
   private Holiday(final String name, final LocalDate fromDate, final LocalDate 
toDate, final LocalDate repaymentsRescheduledTo,
               final Integer status, final boolean processed, final String 
description, final Set<Office> offices,
               final int reschedulingType) {
           if (StringUtils.isNotBlank(name)) {
               this.name = name.trim();
           }
   
           if (fromDate != null) {
               this.fromDate = fromDate;
           }
   
           if (toDate != null) {
               this.toDate = toDate;
           }
   
           if (repaymentsRescheduledTo != null) {
               this.repaymentsRescheduledTo = repaymentsRescheduledTo;
           }
   
           this.status = status;
           this.processed = processed;
   
           if (StringUtils.isNotBlank(name)) {
               this.description = description.trim();
           } else {
               this.description = null;
           }
   
           if (offices != null) {
               this.offices = offices;
           }
           this.reschedulingType = reschedulingType;
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to