Collectors.toList() -> .toList()

master
mjkhan21 5 months ago
parent 0e3552bc89
commit b35a9cf454

@ -2,7 +2,6 @@ package cokr.xit.base.menu;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import cokr.xit.foundation.data.hierarchy.Hierarchy; import cokr.xit.foundation.data.hierarchy.Hierarchy;
@ -38,7 +37,7 @@ public class MenuContext extends Hierarchy<Menu>{
return get(key); return get(key);
}) })
.distinct() .distinct()
.collect(Collectors.toList()); .toList();
ArrayList<Integer> result = new ArrayList<>(); ArrayList<Integer> result = new ArrayList<>();
setIDs(menus, result); setIDs(menus, result);

@ -1,7 +1,6 @@
package cokr.xit.base.menu.web; package cokr.xit.base.menu.web;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -40,12 +39,12 @@ public class MenuInjector extends RequestInterceptor {
private List<String> active; private List<String> active;
private List<String> getActive() { private List<String> 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) { public void setActive(String... active) {
this.active = !isEmpty(active) ? this.active = !isEmpty(active) ?
Stream.of(active).map(String::toLowerCase).collect(Collectors.toList()) Stream.of(active).map(String::toLowerCase).toList()
: null; : null;
} }

Loading…
Cancel
Save