Skip to content
Snippets Groups Projects

Clean up some new Java 17 code smell aroudn stream collection

Merged Martin Lowe requested to merge (removed):malowe/main/code-smell-patch into main
13 files
+ 96
114
Compare changes
  • Side-by-side
  • Inline
Files
13
@@ -12,7 +12,6 @@
package org.eclipsefoundation.git.eca.config;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.eclipsefoundation.git.eca.dto.CommitValidationMessage;
@@ -47,7 +46,7 @@ public class EclipseQuteTemplateExtensions {
* @return a list of flattened errors, or an empty list if (none are found.
*/
static List<CommitValidationMessage> getValidationErrors(List<CommitValidationStatus> statuses) {
return statuses.stream().flatMap(s -> s.getErrors().stream()).collect(Collectors.toList());
return statuses.stream().flatMap(s -> s.getErrors().stream()).toList();
}
/**
@@ -62,7 +61,7 @@ public class EclipseQuteTemplateExtensions {
.filter(s -> s.getErrors().isEmpty())
.map(CommitValidationStatus::getUserMail)
.distinct()
.collect(Collectors.toList());
.toList();
}
/**
Loading