diff --git a/api/src/main/java/io/kafbat/ui/service/TopicsService.java b/api/src/main/java/io/kafbat/ui/service/TopicsService.java index 8c43b77d5..7b5ae20fb 100644 --- a/api/src/main/java/io/kafbat/ui/service/TopicsService.java +++ b/api/src/main/java/io/kafbat/ui/service/TopicsService.java @@ -13,7 +13,6 @@ import io.kafbat.ui.model.InternalLogDirStats; import io.kafbat.ui.model.InternalPartition; import io.kafbat.ui.model.InternalPartitionsOffsets; -import io.kafbat.ui.model.InternalPartitionsOffsets.Offsets; import io.kafbat.ui.model.InternalReplica; import io.kafbat.ui.model.InternalTopic; import io.kafbat.ui.model.InternalTopicConfig; @@ -144,11 +143,13 @@ private Mono getPartitionOffsets(Map (Map) Sets.intersection(earliest.keySet(), latest.keySet()) + (earliest, latest) -> + Sets.intersection(earliest.keySet(), latest.keySet()) .stream() - .map(tp -> Map.entry(tp, - new InternalPartitionsOffsets.Offsets( - earliest.get(tp), latest.get(tp)))) + .map(tp -> + Map.entry(tp, + new InternalPartitionsOffsets.Offsets( + earliest.get(tp), latest.get(tp)))) .collect(toMap(Map.Entry::getKey, Map.Entry::getValue))) .map(InternalPartitionsOffsets::new); } diff --git a/api/src/main/java/io/kafbat/ui/service/audit/AuditService.java b/api/src/main/java/io/kafbat/ui/service/audit/AuditService.java index 7ff131613..22bb77f0b 100644 --- a/api/src/main/java/io/kafbat/ui/service/audit/AuditService.java +++ b/api/src/main/java/io/kafbat/ui/service/audit/AuditService.java @@ -181,11 +181,11 @@ private Mono extractUser(Signal sig) { return sig.getContextView().>get(key) .map(context -> context.getAuthentication().getPrincipal()) - .map(AuditService::extractUserFromObject) + .map(AuditService::extractUser) .switchIfEmpty(Mono.just(UNKNOWN_USER)); } - private static AuthenticatedUser extractUserFromObject(Object principal) { + private static AuthenticatedUser extractUser(Object principal) { if (principal instanceof UserDetails u) { return new AuthenticatedUser(u.getUsername(), Set.of()); } else if (principal instanceof AuthenticatedPrincipal p) {