From 8e385afa8166b44576dfa05a05a0cd55b901ecc0 Mon Sep 17 00:00:00 2001 From: Hilbrand Bouwkamp Date: Mon, 1 Feb 2021 15:37:27 +0100 Subject: [PATCH] [amazonechocontrol] Fix requireNonNullElse: it is java 9 and beyond. (#10018) Signed-off-by: Hilbrand Bouwkamp --- .../amazonechocontrol/internal/handler/EchoHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java index 48116d017ed..c43b3fa42f3 100644 --- a/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java +++ b/bundles/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/handler/EchoHandler.java @@ -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