mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8266155: Convert java.base to use Stream.toList()
Reviewed-by: bpb, naoto, iris, chegar
This commit is contained in:
parent
c36c63a008
commit
dd05158b24
8 changed files with 14 additions and 25 deletions
|
@ -39,7 +39,6 @@ import java.security.PrivilegedActionException;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class IPAddressUtil {
|
||||
private static final int INADDR4SZ = 4;
|
||||
|
@ -359,7 +358,7 @@ public class IPAddressUtil {
|
|||
.filter(a -> (a instanceof Inet6Address)
|
||||
&& address.equals(a)
|
||||
&& ((Inet6Address) a).getScopeId() != 0)
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
List<InetAddress> result;
|
||||
try {
|
||||
result = AccessController.doPrivileged(pa);
|
||||
|
|
|
@ -36,7 +36,6 @@ import static java.util.Locale.LanguageRange.*;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Implementation for BCP47 Locale matching
|
||||
|
@ -184,7 +183,7 @@ public final class LocaleMatcher {
|
|||
Collection<String> tags) {
|
||||
Set<String> distinctTags = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
|
||||
return tags.stream().filter(x -> distinctTags.add(x))
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue