From b35a9cf454720d346f2f0d94f672cf14252a94c5 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Wed, 3 Jul 2024 09:51:16 +0900 Subject: [PATCH] Collectors.toList() -> .toList() --- src/main/java/cokr/xit/base/menu/MenuContext.java | 3 +-- src/main/java/cokr/xit/base/menu/web/MenuInjector.java | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/cokr/xit/base/menu/MenuContext.java b/src/main/java/cokr/xit/base/menu/MenuContext.java index b8237d1..2c33b23 100644 --- a/src/main/java/cokr/xit/base/menu/MenuContext.java +++ b/src/main/java/cokr/xit/base/menu/MenuContext.java @@ -2,7 +2,6 @@ package cokr.xit.base.menu; import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; import java.util.stream.Stream; import cokr.xit.foundation.data.hierarchy.Hierarchy; @@ -38,7 +37,7 @@ public class MenuContext extends Hierarchy{ return get(key); }) .distinct() - .collect(Collectors.toList()); + .toList(); ArrayList result = new ArrayList<>(); setIDs(menus, result); diff --git a/src/main/java/cokr/xit/base/menu/web/MenuInjector.java b/src/main/java/cokr/xit/base/menu/web/MenuInjector.java index 17cc3c0..fc15257 100644 --- a/src/main/java/cokr/xit/base/menu/web/MenuInjector.java +++ b/src/main/java/cokr/xit/base/menu/web/MenuInjector.java @@ -1,7 +1,6 @@ package cokr.xit.base.menu.web; import java.util.List; -import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.Resource; @@ -40,12 +39,12 @@ public class MenuInjector extends RequestInterceptor { private List active; private List getActive() { - return !isEmpty(active) ? active : (active = Stream.of(HTML_GET).collect(Collectors.toList())); + return !isEmpty(active) ? active : (active = Stream.of(HTML_GET).toList()); } public void setActive(String... active) { this.active = !isEmpty(active) ? - Stream.of(active).map(String::toLowerCase).collect(Collectors.toList()) + Stream.of(active).map(String::toLowerCase).toList() : null; }