Use Stream.toList()

See gh-36167
This commit is contained in:
Johnny Lim
2023-07-03 12:00:18 +09:00
committed by Andy Wilkinson
parent bdead8d0e3
commit 0fa58c04e7
8 changed files with 13 additions and 22 deletions

View File

@@ -33,7 +33,6 @@ import java.util.Set;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
@@ -97,7 +96,7 @@ final class ModifiedClassPathClassLoader extends URLClassLoader {
candidates.addAll(getAnnotatedElements(arguments.toArray()));
List<AnnotatedElement> annotatedElements = candidates.stream()
.filter(ModifiedClassPathClassLoader::hasAnnotation)
.collect(Collectors.toList());
.toList();
if (annotatedElements.isEmpty()) {
return null;
}