Skip to content

Commit 04af886

Browse files
authored
[JUnit Platform Engine] Don't use Java 9+ APIs (#3025)
Even though Java 8 is ancient, Cucumber should still work on it.
1 parent 2d3df16 commit 04af886

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
## [Unreleased]
1313
### Fixed
14+
- [JUnit Platform Engine] Don't use Java 9+ APIs ([#3025](https://github.com/cucumber/cucumber-jvm/pull/3025) M.P. Korstanje)
1415
- [JUnit Platform Engine] Implement toString on custom DiscoverySelectors
1516

1617
## [7.25.0] - 2025-07-10

cucumber-junit-platform-engine/src/main/java/io/cucumber/junit/platform/engine/FeatureResolver.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,13 @@ public Resolution resolve(FeatureWithLinesSelector selector) {
130130

131131
@Override
132132
public Resolution resolve(FileSelector selector, Context context) {
133-
Set<DiscoverySelector> selectors = featureParser.parseResource(selector.getPath())
134-
.stream()
135-
.map(feature -> selector.getPosition()
133+
Set<FeatureElementSelector> selectors = featureParser.parseResource(selector.getPath())
134+
.flatMap(feature -> selector.getPosition()
136135
.map(position -> selectElementAt(feature, position))
137136
.orElseGet(() -> Optional.of(selectFeature(feature))))
138-
.filter(Optional::isPresent)
139-
.map(Optional::get)
140-
.collect(toSet());
137+
.map(Collections::singleton)
138+
.orElseGet(Collections::emptySet);
139+
141140
return toResolution(selectors);
142141
}
143142

0 commit comments

Comments
 (0)