Skip to content

Commit

Permalink
fix for java 8 build
Browse files Browse the repository at this point in the history
  • Loading branch information
anhefti committed Nov 16, 2023
1 parent e890265 commit 01f3517
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public Result<Collection<QuizData>> getQuizzes(final Set<String> ids) {
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);
Expand All @@ -225,7 +225,7 @@ public Result<Collection<QuizData>> getQuizzes(final Set<String> ids) {

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));
}
Expand All @@ -246,7 +246,7 @@ public Result<QuizData> getQuiz(final String id) {
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();

Expand Down

0 comments on commit 01f3517

Please sign in to comment.