From 2a858017b7d9a620d1083b69b7ca038c34a5ba89 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 24 Dec 2022 03:15:44 +0300 Subject: `Collectors.toList()` -> `toList()` --- src/main/java/com/juick/www/controllers/Site.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/com/juick/www/controllers/Site.java') diff --git a/src/main/java/com/juick/www/controllers/Site.java b/src/main/java/com/juick/www/controllers/Site.java index dcb89718..dadf7ed6 100644 --- a/src/main/java/com/juick/www/controllers/Site.java +++ b/src/main/java/com/juick/www/controllers/Site.java @@ -95,7 +95,7 @@ public class Site { model.addAttribute("tagStats", tagService.getUserTagStats(user.getUid()).stream() .sorted((e1, e2) -> Integer.compare(e2.getUsageCount(), e1.getUsageCount())).limit(20) - .map(t -> t.getTag().getName()).collect(Collectors.toList())); + .map(t -> t.getTag().getName()).toList()); } @GetMapping("/login") @@ -195,7 +195,7 @@ public class Site { List unread = messagesService.getUnread(visitor); visitor.setUnreadCount(unread.size()); List blUIDs = userService.checkBL(visitor.getUid(), - msgs.stream().map(m -> m.getUser().getUid()).collect(Collectors.toList())); + msgs.stream().map(m -> m.getUser().getUid()).toList()); msgs.forEach(m -> m.ReadOnly |= blUIDs.contains(m.getUser().getUid())); } model.addAttribute("msgs", msgs); @@ -301,7 +301,7 @@ public class Site { List unread = messagesService.getUnread(visitor); visitor.setUnreadCount(unread.size()); List blUIDs = userService.checkBL(visitor.getUid(), - msgs.stream().map(m -> m.getUser().getUid()).collect(Collectors.toList())); + msgs.stream().map(m -> m.getUser().getUid()).toList()); msgs.forEach(m -> m.ReadOnly |= blUIDs.contains(m.getUser().getUid())); } model.addAttribute("msgs", msgs); @@ -338,7 +338,7 @@ public class Site { model.addAttribute("tags", tagService.getUserTagStats(user.getUid()).stream() .sorted((e1, e2) -> Integer.compare(e2.getUsageCount(), e1.getUsageCount())) - .map(t -> t.getTag().getName()).collect(Collectors.toList())); + .map(t -> t.getTag().getName()).toList()); return "views/blog_tags"; } @@ -423,7 +423,7 @@ public class Site { List unread = messagesService.getUnread(visitor); visitor.setUnreadCount(unread.size()); List blUIDs = userService.checkBL(visitor.getUid(), - msgs.stream().map(m -> m.getUser().getUid()).collect(Collectors.toList())); + msgs.stream().map(m -> m.getUser().getUid()).toList()); msgs.forEach(m -> m.ReadOnly |= blUIDs.contains(m.getUser().getUid())); fillUserModel(model, visitor, visitor); } @@ -569,7 +569,7 @@ public class Site { model.addAttribute("visitorSubscribed", messagesService.isSubscribed(visitor.getUid(), msg.getMid())); model.addAttribute("visitorInBL", userService.isInBL(msg.getUser().getUid(), visitor.getUid())); model.addAttribute("recomm", messagesService.getMessagesRecommendations(Collections.singletonList(msg.getMid())) - .stream().map(Pair::getRight).collect(Collectors.toList())); + .stream().map(Pair::getRight).toList()); List blUIDs = new ArrayList<>(); for (Message reply : replies) { if (reply.getUser().getUid() != msg.getUser().getUid() && !blUIDs.contains(reply.getUser().getUid())) { @@ -609,7 +609,7 @@ public class Site { model.addAttribute("tags", tagService.getUserTagStats(visitor.getUid()).stream() .sorted((e1, e2) -> Integer.compare(e2.getUsageCount(), e1.getUsageCount())) - .map(t -> t.getTag().getName()).collect(Collectors.toList())); + .map(t -> t.getTag().getName()).toList()); return "views/post"; } -- cgit v1.2.3