[amazonechocontrol] Fix requireNonNullElse: it is java 9 and beyond. (#10018)

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
This commit is contained in:
Hilbrand Bouwkamp 2021-02-01 15:37:27 +01:00 committed by GitHub
parent 72f43bde98
commit 8e385afa81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,7 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
@ -1279,7 +1280,7 @@ public class EchoHandler extends BaseThingHandler implements IEchoThingHandler {
if (StringUtils.equals(notification.status, "ON")) {
if ("Reminder".equals(notification.type)) {
String offset = ZoneId.systemDefault().getRules().getOffset(Instant.now()).toString();
String time = Objects.requireNonNullElse(notification.originalTime, "00:00:00");
String time = Optional.ofNullable(notification.originalTime).orElse("00:00:00");
ZonedDateTime alarmTime = ZonedDateTime.parse(notification.originalDate + "T" + time + offset);
if (StringUtils.isNotBlank(notification.recurringPattern) && alarmTime.isBefore(now)) {
continue; // Ignore recurring entry if alarm time is before now