diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-12-04 23:02:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-04 23:02:31 +0100 |
commit | 2555b49b4390ed9dac9eab3959d6cc6e3511515c (patch) | |
tree | 88ab77cc41620eb2b8639b10b7edd1e57b901f12 /config-model-api/src/main/java/com/yahoo | |
parent | fae49834f53500587921196e86ee4af4c670d8c9 (diff) | |
parent | fd54b4e4b136b05b67b471dca3ca6ce3dd116710 (diff) |
Merge pull request #25103 from vespa-engine/balder/manual-revert-of-25097
Revert collect(Collectors.toList())
Diffstat (limited to 'config-model-api/src/main/java/com/yahoo')
3 files changed, 10 insertions, 10 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java b/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java index 6c519a4656e..f69bd5fa475 100644 --- a/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java +++ b/config-model-api/src/main/java/com/yahoo/config/application/api/DeploymentSpec.java @@ -222,7 +222,7 @@ public class DeploymentSpec { private static List<DeploymentInstanceSpec> instances(List<DeploymentSpec.Step> steps) { return steps.stream() .flatMap(DeploymentSpec::flatten) - .toList(); + .collect(Collectors.toList()); } private static Stream<DeploymentInstanceSpec> flatten(Step step) { diff --git a/config-model-api/src/main/java/com/yahoo/config/application/api/TimeWindow.java b/config-model-api/src/main/java/com/yahoo/config/application/api/TimeWindow.java index 8256237dc43..746d7226d82 100644 --- a/config-model-api/src/main/java/com/yahoo/config/application/api/TimeWindow.java +++ b/config-model-api/src/main/java/com/yahoo/config/application/api/TimeWindow.java @@ -79,7 +79,7 @@ public class TimeWindow { hours.toString() + " on " + days.stream().map(DayOfWeek::name) .map(String::toLowerCase) - .toList() + + .collect(Collectors.toList()) + " in time zone " + zone + " and " + dateRange.toString(); } @@ -90,7 +90,7 @@ public class TimeWindow { ? List.copyOf(dateRange.days()) // Default to the days contained in the date range : parse(daySpec, TimeWindow::parseDays); List<Integer> hours = hourSpec.isEmpty() - ? IntStream.rangeClosed(0, 23).boxed().toList() // All hours by default + ? IntStream.rangeClosed(0, 23).boxed().collect(Collectors.toList()) // All hours by default : parse(hourSpec, TimeWindow::parseHours); ZoneId zone = zoneFrom(zoneSpec.isEmpty() ? "UTC" : zoneSpec); return new TimeWindow(days, hours, zone, dateRange); @@ -123,7 +123,7 @@ public class TimeWindow { endInclusive)); } return IntStream.rangeClosed(start, end).boxed() - .toList(); + .collect(Collectors.toList()); } /** Returns a list of all days occurring between startInclusive and endInclusive */ @@ -136,7 +136,7 @@ public class TimeWindow { } return IntStream.rangeClosed(start.getValue(), end.getValue()).boxed() .map(DayOfWeek::of) - .toList(); + .collect(Collectors.toList()); } /** Parse day of week from string */ diff --git a/config-model-api/src/main/java/com/yahoo/config/application/api/xml/DeploymentSpecXmlReader.java b/config-model-api/src/main/java/com/yahoo/config/application/api/xml/DeploymentSpecXmlReader.java index 8182e697e7e..c1ecddee456 100644 --- a/config-model-api/src/main/java/com/yahoo/config/application/api/xml/DeploymentSpecXmlReader.java +++ b/config-model-api/src/main/java/com/yahoo/config/application/api/xml/DeploymentSpecXmlReader.java @@ -215,7 +215,7 @@ public class DeploymentSpecXmlReader { notifications, endpoints, now)) - .toList(); + .collect(Collectors.toList()); } private List<Step> readSteps(Element stepTag, Map<String, String> prodAttributes, Element parentTag) { @@ -250,7 +250,7 @@ public class DeploymentSpecXmlReader { case prodTag: // regions, delay and parallel may be nested within, but we can flatten them return XML.getChildren(stepTag).stream() .flatMap(child -> readNonInstanceSteps(child, prodAttributes, stepTag).stream()) - .toList(); + .collect(Collectors.toList()); case delayTag: return List.of(new Delay(Duration.ofSeconds(longAttribute("hours", stepTag) * 60 * 60 + longAttribute("minutes", stepTag) * 60 + @@ -258,11 +258,11 @@ public class DeploymentSpecXmlReader { case parallelTag: // regions and instances may be nested within return List.of(new ParallelSteps(XML.getChildren(stepTag).stream() .flatMap(child -> readSteps(child, prodAttributes, parentTag).stream()) - .toList())); + .collect(Collectors.toList()))); case stepsTag: // regions and instances may be nested within return List.of(new Steps(XML.getChildren(stepTag).stream() .flatMap(child -> readSteps(child, prodAttributes, parentTag).stream()) - .toList())); + .collect(Collectors.toList()))); case regionTag: return List.of(readDeclaredZone(Environment.prod, athenzService, testerFlavor, stepTag)); default: @@ -378,7 +378,7 @@ public class DeploymentSpecXmlReader { * Imposes some constraints on tag order which are not expressible in the schema */ private void validateTagOrder(Element root) { - List<String> tags = XML.getChildren(root).stream().map(Element::getTagName).toList(); + List<String> tags = XML.getChildren(root).stream().map(Element::getTagName).collect(Collectors.toList()); for (int i = 0; i < tags.size(); i++) { if (tags.get(i).equals(blockChangeTag)) { String constraint = "<block-change> must be placed after <test> and <staging> and before <prod>"; |