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/Settings.java | 2 +- src/main/java/com/juick/www/controllers/Site.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/juick/www/controllers') diff --git a/src/main/java/com/juick/www/controllers/Settings.java b/src/main/java/com/juick/www/controllers/Settings.java index 0b486766..b990bf41 100644 --- a/src/main/java/com/juick/www/controllers/Settings.java +++ b/src/main/java/com/juick/www/controllers/Settings.java @@ -107,7 +107,7 @@ public class Settings { model.addAttribute("emails", userService.getEmails(visitor)); model.addAttribute("jids", userService.getAllJIDs(visitor)); List hours = IntStream.rangeClosed(0, 23).boxed() - .map(i -> StringUtils.leftPad(String.format("%d", i), 2, "0")).collect(Collectors.toList()); + .map(i -> StringUtils.leftPad(String.format("%d", i), 2, "0")).toList(); model.addAttribute("hours", hours); model.addAttribute("fbstatus", userService.getFbCrossPostStatus(visitor.getUid())); model.addAttribute("twitter_name", userService.getTwitterName(visitor.getUid())); 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