Skip to content

Commit

Permalink
Change orElse to OrElseGet
Browse files Browse the repository at this point in the history
  • Loading branch information
mraible committed Apr 5, 2024
1 parent d63a00f commit ec1f6b1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ private User createUser() {
}

private void createBloodPressureByMonth(ZonedDateTime firstDate, ZonedDateTime firstDayOfLastMonth) {
User user = userRepository.findOneByLogin("user").orElse(createUser());
User user = userRepository.findOneByLogin("user").orElseGet(this::createUser);

bloodPressure = new BloodPressure(firstDate, 120, 80, user);
bloodPressureRepository.saveAndFlush(bloodPressure);
Expand Down

0 comments on commit ec1f6b1

Please sign in to comment.