Commit b298efc1 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #13727 from dreis2211:polish-collectors

* pr/13727:
  Polish "Polish some Collectors"
  Polish some Collectors
parents 10c3c080 d9c0dbb9
......@@ -20,7 +20,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
import java.util.stream.Collectors;
......@@ -83,7 +82,7 @@ public class ExposeExcludePropertyEndpointFilter<E extends ExposableEndpoint<?>>
return Collections.emptySet();
}
return items.stream().map((item) -> item.toLowerCase(Locale.ENGLISH))
.collect(Collectors.toCollection(HashSet::new));
.collect(Collectors.toSet());
}
@Override
......
......@@ -158,7 +158,7 @@ public class MetricsEndpoint {
private <K, V, T> List<T> asList(Map<K, V> map, BiFunction<K, V, T> mapper) {
return map.entrySet().stream()
.map((entry) -> mapper.apply(entry.getKey(), entry.getValue()))
.collect(Collectors.toCollection(ArrayList::new));
.collect(Collectors.toList());
}
/**
......
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -48,7 +48,7 @@ public class AutoConfigurations extends Configurations implements Ordered {
@Override
protected Collection<Class<?>> sort(Collection<Class<?>> classes) {
List<String> names = classes.stream().map(Class::getName)
.collect(Collectors.toCollection(ArrayList::new));
.collect(Collectors.toList());
List<String> sorted = SORTER.getInPriorityOrder(names);
return sorted.stream()
.map((className) -> ClassUtils.resolveClassName(className, null))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment