From 270d7a2282bd30d95e02816d531ff43af908cf35 Mon Sep 17 00:00:00 2001 From: anhefti Date: Wed, 2 Feb 2022 12:29:01 +0100 Subject: [PATCH] fixed flatMap bug --- .../session/impl/ExamConfigUpdateServiceImpl.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamConfigUpdateServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamConfigUpdateServiceImpl.java index 7663f1b5..3c369f10 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamConfigUpdateServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamConfigUpdateServiceImpl.java @@ -312,9 +312,7 @@ public class ExamConfigUpdateServiceImpl implements ExamConfigUpdateService { private Collection> lockForUpdate(final Collection examIds, final String update) { return examIds.stream() - .map(id -> this.examDAO.byPK(id) - .map(exam -> this.examDAO.placeLock(exam, update)) - .getOrThrow()) + .map(id -> this.examDAO.byPK(id).flatMap(exam -> this.examDAO.placeLock(exam, update))) .collect(Collectors.toList()); }