diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-12-02 22:37:16 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-12-02 22:37:16 +0000 |
commit | 6954a0d10fddb9bee32931ba69b2d4b427ee71e2 (patch) | |
tree | 21e6aad059615f27c6357227e6af608a7b965ec5 /bundle-plugin | |
parent | afcf1bb71cb7b87a03149d197f724cfc7603ef92 (diff) |
collect(Collectors.toList()) -> toList()
Diffstat (limited to 'bundle-plugin')
2 files changed, 5 insertions, 5 deletions
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 e058e0dfa6f..00c915b8b91 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 @@ -138,7 +138,7 @@ abstract class AbstractGenerateOsgiManifestMojo extends AbstractMojo { private Collection<String> osgiExportPackages(Map<String, ExportPackageAnnotation> exportedPackages) { return exportedPackages.entrySet().stream().map(entry -> entry.getKey() + ";version=" + entry.getValue().osgiVersion()) - .collect(Collectors.toList()); + .toList(); } private static String asOsgiImport(String packageName, Optional<String> version) { @@ -189,7 +189,7 @@ abstract class AbstractGenerateOsgiManifestMojo extends AbstractMojo { } else if (parameters.size() == 0) { return Optional.empty(); } else { - List<String> paramNames = parameters.stream().map(ExportPackages.Parameter::getName).collect(Collectors.toList()); + List<String> paramNames = parameters.stream().map(ExportPackages.Parameter::getName).toList(); throw new RuntimeException("A single, optional version parameter expected, but got " + paramNames); } } diff --git a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java index 7e5ba3d91ce..f5d3259c537 100644 --- a/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java +++ b/bundle-plugin/src/main/java/com/yahoo/container/plugin/mojo/GenerateOsgiManifestMojo.java @@ -70,7 +70,7 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo { throwIfInternalContainerArtifactsAreIncluded(artifactSet.getJarArtifactsToInclude()); List<Export> exportedPackagesFromProvidedJars = exportedPackagesAggregated( - artifactSet.getJarArtifactsProvided().stream().map(Artifact::getFile).collect(Collectors.toList())); + artifactSet.getJarArtifactsProvided().stream().map(Artifact::getFile).toList()); // Packages from Export-Package headers in provided scoped jars Set<String> exportedPackagesFromProvidedDeps = ExportPackages.packageNames(exportedPackagesFromProvidedJars); @@ -182,7 +182,7 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo { private void warnOnUnsupportedArtifacts(Collection<Artifact> nonJarArtifacts) { List<Artifact> unsupportedArtifacts = nonJarArtifacts.stream().filter(a -> ! a.getType().equals("pom")) - .collect(Collectors.toList()); + .toList(); unsupportedArtifacts.forEach(artifact -> getLog() .warn(String.format("Unsupported artifact '%s': Type '%s' is not supported. Please file a feature request.", @@ -215,7 +215,7 @@ public class GenerateOsgiManifestMojo extends AbstractGenerateOsgiManifestMojo { List<ClassFileMetaData> analyzedClasses = allDescendantFiles(outputDirectory) .filter(file -> file.getName().endsWith(".class")) .map(classFile -> Analyze.analyzeClass(classFile, artifactVersionOrNull(bundleVersion))) - .collect(Collectors.toList()); + .toList(); return PackageTally.fromAnalyzedClassFiles(analyzedClasses); } |