From 807341e685976b2ce7d0e80e48a3b8b076952f34 Mon Sep 17 00:00:00 2001 From: upagge Date: Mon, 4 May 2020 23:08:44 +0300 Subject: [PATCH] =?UTF-8?q?release=201.9.3=20=D0=98=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=B1=D0=B0=D0=B3=20=D1=81=20=D0=B4?= =?UTF-8?q?=D0=B5=D1=84=D0=BE=D0=BB=D1=82=D0=BD=D1=8B=D0=BC=20=D1=8E=D0=BD?= =?UTF-8?q?=D0=B8=D1=82=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- src/main/java/org/sadtech/autoresponder/AutoResponder.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 66bc948..e35a9a9 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.sadtech.autoresponder autoresponder - 1.10-SNAPSHOT + 1.9.3-RELEASE jar Abstract Autoresponder diff --git a/src/main/java/org/sadtech/autoresponder/AutoResponder.java b/src/main/java/org/sadtech/autoresponder/AutoResponder.java index e309b74..1f2c15c 100644 --- a/src/main/java/org/sadtech/autoresponder/AutoResponder.java +++ b/src/main/java/org/sadtech/autoresponder/AutoResponder.java @@ -62,8 +62,10 @@ public class AutoResponder { } else { unitPointerService.save(new UnitPointer<>(entityId, unitAnswer)); } + return answer; + } else { + return Optional.ofNullable(defaultUnit); } - return answer; } /** @@ -103,8 +105,7 @@ public class AutoResponder { } } } - final Optional max = searchUnit.stream().max(UNIT_PRIORITY_COMPARATOR); - return max.isPresent() ? max : Optional.ofNullable(defaultUnit); + return searchUnit.stream().max(UNIT_PRIORITY_COMPARATOR); } private boolean patternReg(@NonNull U unit, String message) {