aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/controllers
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-12-24 03:15:44 +0300
committerGravatar Vitaly Takmazov2022-12-24 03:15:44 +0300
commit2a858017b7d9a620d1083b69b7ca038c34a5ba89 (patch)
tree3b192b9ab0aee2a38bbd3243a2977409ae6a033e /src/main/java/com/juick/www/controllers
parent54f27794e7fee1113115baafe1b86fdbcde8e7c2 (diff)
`Collectors.toList()` -> `toList()`
Diffstat (limited to 'src/main/java/com/juick/www/controllers')
-rw-r--r--src/main/java/com/juick/www/controllers/Settings.java2
-rw-r--r--src/main/java/com/juick/www/controllers/Site.java14
2 files changed, 8 insertions, 8 deletions
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<String> 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<Integer> unread = messagesService.getUnread(visitor);
visitor.setUnreadCount(unread.size());
List<Integer> 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<Integer> unread = messagesService.getUnread(visitor);
visitor.setUnreadCount(unread.size());
List<Integer> 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<Integer> unread = messagesService.getUnread(visitor);
visitor.setUnreadCount(unread.size());
List<Integer> 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<Integer> 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";
}