From afee339e161f4e169e96ae9b328faf20ee1a1510 Mon Sep 17 00:00:00 2001 From: Keir Nellyer Date: Tue, 4 Oct 2016 16:20:11 +0100 Subject: [PATCH] Any report with a handler and no conclusion is an active report, therefore we don't need to check if the report is active --- .../mineplex/core/report/ReportManager.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportManager.java b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportManager.java index 902de4282..0710cbba2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/report/ReportManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/report/ReportManager.java @@ -553,22 +553,22 @@ public class ReportManager reportIds.stream().map(_reportRepository::getReport).collect(Collectors.toList()) ).thenCompose(UtilFuture::sequence) .thenApply(UtilCollections::unboxPresent) - .thenCompose(reports -> UtilFuture.filter(reports, this::isActiveReport)).thenApply(reports -> - { - Report report = null; - int size = reports.size(); + .thenApply(reports -> + { + Report report = null; + int size = reports.size(); - if (size == 1) - { - report = reports.get(0); - } - else if (size > 1) - { - throw new IllegalStateException("Account is handling multiple reports."); - } + if (size == 1) + { + report = reports.get(0); + } + else if (size > 1) + { + throw new IllegalStateException("Account is handling multiple reports."); + } - return Optional.ofNullable(report); - }); + return Optional.ofNullable(report); + }); future.exceptionally(throwable -> Optional.empty());