fix for java 8 build

This commit is contained in:
anhefti 2023-11-16 11:30:00 +01:00
parent e89026591e
commit 01f3517989

View file

@ -213,7 +213,7 @@ public class MoodlePluginCourseAccess extends AbstractCachedCourseAccess impleme
final Set<String> missingIds = new HashSet<>(ids);
final Collection<QuizData> result = new ArrayList<>();
final Set<String> fromCache = ids.stream()
.map(super::getFromCache)
.map(id -> super.getFromCache(id))
.filter(Objects::nonNull)
.map(qd -> {
result.add(qd);
@ -225,7 +225,7 @@ public class MoodlePluginCourseAccess extends AbstractCachedCourseAccess impleme
result.addAll(getRestTemplate()
.map(template -> getQuizzesForIds(template, ids))
.map(super::putToCache)
.map(q -> super.putToCache(q))
.onError(error -> log.error("Failed to get courses for: {}", ids, error))
.getOrElse(Collections::emptyList));
}
@ -246,7 +246,7 @@ public class MoodlePluginCourseAccess extends AbstractCachedCourseAccess impleme
final Set<String> ids = Stream.of(id).collect(Collectors.toSet());
final Iterator<QuizData> iterator = getRestTemplate()
.map(template -> getQuizzesForIds(template, ids))
.map(super::putToCache)
.map(q -> super.putToCache(q))
.getOr(Collections.emptyList())
.iterator();