diff --git a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java index c404769..2424f65 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestEmployeeView.java @@ -240,7 +240,7 @@ public class RequestEmployeeView extends Div implements HasUrlParameter .sum(); } - private int getStartDateYear(TimeOffRequest request) { + private int getStartDateYear(final TimeOffRequest request) { if (request.getStartDate() != null) { return request.getStartDate().getYear(); } @@ -349,19 +349,19 @@ public class RequestEmployeeView extends Div implements HasUrlParameter return employeeService.getEmployee(employeeId).getGender() == Employee.Gender.MALE; } - private boolean isValidRequestType(TimeOffRequestType type, boolean isMale) { + private boolean isValidRequestType(final TimeOffRequestType type, final boolean isMale) { return !getStandardExclusions().contains(type) && !(isMale && getMaleSpecificExclusions().contains(type)) && type != TimeOffRequestType.TODOS; } - private TimeOffRequest createRequest(TimeOffRequestType type) { + private TimeOffRequest createRequest(final TimeOffRequestType type) { TimeOffRequest request = new TimeOffRequest(); request.setCategory(type); return request; } - private boolean isVacationExpired(TimeOffRequest request) { + private boolean isVacationExpired(final TimeOffRequest request) { Vacation vacation = vacationService.findVacationByCategory(request.getCategory()); if (vacation != null && vacation.getMonthOfYear() != null && vacation.getDayOfMonth() != null) { @@ -376,7 +376,7 @@ public class RequestEmployeeView extends Div implements HasUrlParameter return false; } - private boolean shouldIncludeRequest(TimeOffRequestType type) { + private boolean shouldIncludeRequest(final TimeOffRequestType type) { List existingRequest = requestService.findByEmployeeAndCategory(employeeId, type); return existingRequest.isEmpty(); } diff --git a/src/main/java/com/primefactorsolutions/views/RequestsListView.java b/src/main/java/com/primefactorsolutions/views/RequestsListView.java index d9c4c09..41639bf 100644 --- a/src/main/java/com/primefactorsolutions/views/RequestsListView.java +++ b/src/main/java/com/primefactorsolutions/views/RequestsListView.java @@ -196,8 +196,9 @@ public class RequestsListView extends Main { return employeeRequests.stream() .filter(Objects::nonNull) .filter(request -> request.getStartDate() != null && ( - request.getStartDate().getYear() == currentYear || - (request.getCategory().name().startsWith("VACACION") && request.getStartDate().getYear() == currentYear - 1) + request.getStartDate().getYear() == currentYear + || (request.getCategory().name().startsWith("VACACION") + && request.getStartDate().getYear() == currentYear - 1) )) .mapToDouble(request -> request.getDaysToBeTake() != null ? request.getDaysToBeTake() : 0.0) .sum();