From e7239db2e2f7e88da4ef56fc5712e493fdd515f8 Mon Sep 17 00:00:00 2001 From: "M.P. Korstanje" Date: Wed, 20 Apr 2022 20:57:07 +0200 Subject: [PATCH] [Core] Remove usage of since Collectors.toUnmodifiableList (#2531) Collectors.toUnmodifiableList was introduced since java 10. Which is slightly too modern for us to use. Fixes #2530 --- CHANGELOG.md | 1 + .../core/gherkin/messages/GherkinMessagesFeatureParser.java | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41a8cd2702..97c6c60bdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Removed ### Fixed + - [Core] Removed usage of since Java 10 `Collectors.toUnmodifiableList()` method ([#2531](https://github.com/cucumber/cucumber-jvm/pull/2531) M.P. Korstanje) ## [7.3.0] (2022-04-19) diff --git a/gherkin-messages/src/main/java/io/cucumber/core/gherkin/messages/GherkinMessagesFeatureParser.java b/gherkin-messages/src/main/java/io/cucumber/core/gherkin/messages/GherkinMessagesFeatureParser.java index 99d1d1e21e..9c026b345c 100644 --- a/gherkin-messages/src/main/java/io/cucumber/core/gherkin/messages/GherkinMessagesFeatureParser.java +++ b/gherkin-messages/src/main/java/io/cucumber/core/gherkin/messages/GherkinMessagesFeatureParser.java @@ -17,7 +17,6 @@ import java.util.Optional; import java.util.UUID; import java.util.function.Supplier; -import java.util.stream.Collectors; import static io.cucumber.messages.types.SourceMediaType.TEXT_X_CUCUMBER_GHERKIN_PLAIN; import static java.util.stream.Collectors.toList; @@ -30,7 +29,7 @@ public Optional parse(URI path, String source, Supplier idGenerat .idGenerator(() -> idGenerator.get().toString()) .build() .parse(Envelope.of(new Source(path.toString(), source, TEXT_X_CUCUMBER_GHERKIN_PLAIN))) - .collect(Collectors.toUnmodifiableList()); + .collect(toList()); List errors = envelopes.stream() .map(Envelope::getParseError)