Skip to content

Commit

Permalink
java: Do not expose EnumMap as implementation detail
Browse files Browse the repository at this point in the history
  • Loading branch information
mpkorstanje committed Nov 15, 2024
1 parent 009976c commit 9c14d71
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
## Fixed
- [Java] Don't expose `EnumMap` implementation detail

## [13.0.1] - 2024-11-14
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Choosing which type to use in another language based on what we did in Java is a
| `Optional<T>` | `T \| undefined`[^1] |
| `List<T>` | `ReadonlyArray<T>` |
| `Map<K, V>` | `Map<K, V>` |
| `EnumMap<K, V>` | `Record<K, V>` |
| `Map<K, V>` | `Record<K, V>` |
| `List<Entry<T, V>>` | `ReadonlyArray<[T, V]>` |

[^1]: See <https://github.com/sindresorhus/meta/discussions/7>
2 changes: 1 addition & 1 deletion java/src/main/java/io/cucumber/query/NamingStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public enum ExampleName {

/**
* Number examples, and if the pickle name is parameterized include it
* too. For example {@code #1.2 - Eating 6 cucumbers}.
* too. For example {@code #1.2: Eating 6 cucumbers}.
*/
NUMBER_AND_PICKLE_IF_PARAMETERIZED
}
Expand Down
4 changes: 2 additions & 2 deletions java/src/main/java/io/cucumber/query/Query.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public final class Query {
private TestRunStarted testRunStarted;
private TestRunFinished testRunFinished;

public EnumMap<TestStepResultStatus, Long> countMostSevereTestStepResultStatus() {
final EnumMap<TestStepResultStatus, Long> results = new EnumMap<>(ZEROES_BY_TEST_STEP_RESULT_STATUSES);
public Map<TestStepResultStatus, Long> countMostSevereTestStepResultStatus() {
EnumMap<TestStepResultStatus, Long> results = new EnumMap<>(ZEROES_BY_TEST_STEP_RESULT_STATUSES);
results.putAll(findAllTestCaseStarted().stream()
.map(this::findMostSevereTestStepResultBy)
.filter(Optional::isPresent)
Expand Down

0 comments on commit 9c14d71

Please sign in to comment.