From 16ea68abd238c91016df203d37047e5dd3037144 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Tue, 17 Jan 2023 22:41:28 +0100 Subject: Unify on Streams.toList() --- .../container/plugin/mojo/AbstractGenerateOsgiManifestMojo.java | 3 +-- .../container/plugin/mojo/GenerateTestBundleOsgiManifestMojo.java | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo') diff --git a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AbstractGenerateOsgiManifestMojo.java b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AbstractGenerateOsgiManifestMojo.java index 00c915b8b91..e5b9938cdb4 100644 --- a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AbstractGenerateOsgiManifestMojo.java +++ b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/AbstractGenerateOsgiManifestMojo.java @@ -33,7 +33,6 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import static com.yahoo.container.plugin.util.IO.withFileOutputStream; -import static java.util.stream.Collectors.toList; /** * @author bjorncs @@ -175,7 +174,7 @@ abstract class AbstractGenerateOsgiManifestMojo extends AbstractMojo { String[] parts = projectVersion.split("-", 2); List numericPart = Stream.of(parts[0].split("\\.")).map(s -> Strings.replaceEmptyString(s, "0")).limit(3) - .collect(toList()); + .collect(Collectors.toCollection(ArrayList::new)); while (numericPart.size() < 3) { numericPart.add("0"); } diff --git a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateTestBundleOsgiManifestMojo.java b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateTestBundleOsgiManifestMojo.java index 5708d90f82f..9ee658ddc22 100644 --- a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateTestBundleOsgiManifestMojo.java +++ b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateTestBundleOsgiManifestMojo.java @@ -26,7 +26,6 @@ import static com.yahoo.container.plugin.util.TestBundleUtils.outputDirectory; import static com.yahoo.container.plugin.osgi.ExportPackages.exportsByPackageName; import static com.yahoo.container.plugin.osgi.ImportPackages.calculateImports; import static com.yahoo.container.plugin.util.Files.allDescendantFiles; -import static java.util.stream.Collectors.toList; /** * @author bjorncs @@ -44,7 +43,7 @@ public class GenerateTestBundleOsgiManifestMojo extends AbstractGenerateOsgiMani List providedJars = artifactSet.getJarArtifactsProvided().stream() .map(Artifact::getFile) - .collect(toList()); + .toList(); List exportedPackagesFromProvidedJars = exportedPackagesAggregated(providedJars); @@ -79,7 +78,7 @@ public class GenerateTestBundleOsgiManifestMojo extends AbstractGenerateOsgiMani allDescendantFiles(new File(project.getBuild().getTestOutputDirectory()))) .filter(file -> file.getName().endsWith(".class")) .map(classFile -> Analyze.analyzeClass(classFile, null)) - .collect(toList()); + .toList(); } private static List referencedTestCategories(List analyzedClasses) { @@ -93,7 +92,7 @@ public class GenerateTestBundleOsgiManifestMojo extends AbstractGenerateOsgiMani "ai.vespa.hosted.cd.ProductionTest") .filter(referencedClasses::contains) .map(name -> name.substring(19)) - .collect(toList()); + .toList(); } } -- cgit v1.2.3