diff --git a/start-site-verification/src/test/java/io/spring/start/site/DependencyResolver.java b/start-site-verification/src/test/java/io/spring/start/site/DependencyResolver.java index 3efb658d728..fae4953711a 100644 --- a/start-site-verification/src/test/java/io/spring/start/site/DependencyResolver.java +++ b/start-site-verification/src/test/java/io/spring/start/site/DependencyResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -21,7 +21,6 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; import java.util.stream.Stream; import io.spring.initializr.metadata.BillOfMaterials; @@ -124,7 +123,7 @@ private List getManagedDependencies(List boms, List return boms.stream() .flatMap((bom) -> getManagedDependencies(bom.getGroupId(), bom.getArtifactId(), bom.getVersion(), repositories)) - .collect(Collectors.toList()); + .toList(); } private Stream getManagedDependencies(String groupId, String artifactId, String version, diff --git a/start-site-verification/src/test/java/io/spring/start/site/MetadataVerificationTests.java b/start-site-verification/src/test/java/io/spring/start/site/MetadataVerificationTests.java index e77d6ddd2d2..57dd94ee076 100644 --- a/start-site-verification/src/test/java/io/spring/start/site/MetadataVerificationTests.java +++ b/start-site-verification/src/test/java/io/spring/start/site/MetadataVerificationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -22,7 +22,6 @@ import java.util.List; import java.util.Map; import java.util.function.Consumer; -import java.util.stream.Collectors; import java.util.stream.Stream; import io.spring.initializr.generator.version.Version; @@ -161,7 +160,7 @@ private Collection bootVersions() { .stream() .map(DefaultMetadataElement::getId) .map(VersionParser.DEFAULT::parse) - .collect(Collectors.toList()); + .toList(); } private Collection groups() { @@ -172,7 +171,7 @@ private Collection dependenciesForBootVersion(DependencyGroup group, return group.getContent() .stream() .filter((dependency) -> dependency.match(bootVersion)) - .collect(Collectors.toList()); + .toList(); } } diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/springazure/SpringAzureModuleRegistry.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/springazure/SpringAzureModuleRegistry.java index 86f30bb4465..095d60c5a76 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/springazure/SpringAzureModuleRegistry.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/springazure/SpringAzureModuleRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -18,7 +18,6 @@ import java.util.Arrays; import java.util.function.Consumer; -import java.util.stream.Collectors; import io.spring.initializr.generator.buildsystem.Build; import io.spring.initializr.generator.buildsystem.Dependency; @@ -33,6 +32,7 @@ * @author Andy Wilkinson * @author Yonghui Ye * @author Stephane Nicoll + * @author Eddú Meléndez */ abstract class SpringAzureModuleRegistry { @@ -55,7 +55,7 @@ static Iterable createSpringBootRegistry() { } private static Iterable create(ImplicitDependency.Builder... dependencies) { - return Arrays.stream(dependencies).map(Builder::build).collect(Collectors.toList()); + return Arrays.stream(dependencies).map(Builder::build).toList(); } private static ImplicitDependency.Builder onDependencies(String... dependencyIds) { diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/springintegration/SpringIntegrationModuleRegistry.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/springintegration/SpringIntegrationModuleRegistry.java index 369d15db5e3..054f959d399 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/springintegration/SpringIntegrationModuleRegistry.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/springintegration/SpringIntegrationModuleRegistry.java @@ -19,7 +19,6 @@ import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; -import java.util.stream.Collectors; import io.spring.initializr.generator.buildsystem.Build; import io.spring.initializr.generator.buildsystem.Dependency; @@ -37,6 +36,7 @@ * @author Artem Bilan * @author Stephane Nicoll * @author Moritz Halbritter + * @author Eddú Meléndez */ abstract class SpringIntegrationModuleRegistry { @@ -86,7 +86,7 @@ static Iterable create(Version platformVersion) { .andThen(addReferenceLink("WebSocket Module", "web-sockets")))); builders.add(onDependencies("web-services").customizeBuild(addDependency("ws")) .customizeHelpDocument(addReferenceLink("Web Services Module", "ws"))); - return builders.stream().map(Builder::build).collect(Collectors.toList()); + return builders.stream().map(Builder::build).toList(); } private static ImplicitDependency.Builder onDependencies(String... dependencyIds) { diff --git a/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersModuleRegistry.java b/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersModuleRegistry.java index 3622622c972..f3f694d0482 100644 --- a/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersModuleRegistry.java +++ b/start-site/src/main/java/io/spring/start/site/extension/dependency/testcontainers/TestcontainersModuleRegistry.java @@ -19,7 +19,6 @@ import java.util.ArrayList; import java.util.List; import java.util.function.Consumer; -import java.util.stream.Collectors; import io.spring.initializr.generator.buildsystem.Build; import io.spring.initializr.generator.buildsystem.Dependency; @@ -102,7 +101,7 @@ static Iterable create(Version platformVersion) { builders.add(onDependencies("spring-ai-vectordb-weaviate").customizeBuild(addModule("weaviate")) .customizeHelpDocument(addReferenceLink("Weaviate Module", "testcontainers/"))); } - return builders.stream().map(Builder::build).collect(Collectors.toList()); + return builders.stream().map(Builder::build).toList(); } private static ImplicitDependency.Builder onDependencies(String... dependencyIds) { diff --git a/start-site/src/main/java/io/spring/start/site/support/StartInitializrMetadataUpdateStrategy.java b/start-site/src/main/java/io/spring/start/site/support/StartInitializrMetadataUpdateStrategy.java index b3c9019eb45..c3f6763d08f 100644 --- a/start-site/src/main/java/io/spring/start/site/support/StartInitializrMetadataUpdateStrategy.java +++ b/start-site/src/main/java/io/spring/start/site/support/StartInitializrMetadataUpdateStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 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. @@ -17,7 +17,6 @@ package io.spring.start.site.support; import java.util.List; -import java.util.stream.Collectors; import com.fasterxml.jackson.databind.ObjectMapper; import io.spring.initializr.generator.version.Version; @@ -33,6 +32,7 @@ * * @author Stephane Nicoll * @author Moritz Halbritter + * @author Eddú Meléndez */ public class StartInitializrMetadataUpdateStrategy extends SpringIoInitializrMetadataUpdateStrategy { @@ -45,8 +45,7 @@ public StartInitializrMetadataUpdateStrategy(RestTemplate restTemplate, ObjectMa @Override protected List fetchSpringBootVersions(String url) { List versions = super.fetchSpringBootVersions(url); - return (versions != null) ? versions.stream().filter(this::isCompatibleVersion).collect(Collectors.toList()) - : null; + return (versions != null) ? versions.stream().filter(this::isCompatibleVersion).toList() : null; } private boolean isCompatibleVersion(DefaultMetadataElement versionMetadata) {