Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore old API for merge #114

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/edu/hm/hafner/coverage/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@
*
* @return a new tree with the merged {@link Node nodes}
*/
public static Node merge(final List<Node> nodes) {
public static Node merge(final List<? extends Node> nodes) {
if (nodes.isEmpty()) {
throw new IllegalArgumentException("Cannot merge an empty list of nodes");
}
Expand All @@ -707,6 +707,7 @@

if (grouped.size() == 1) {
return nodes.stream()
.map(Node.class::cast)
Dismissed Show dismissed Hide dismissed
.reduce(Node::merge)
.orElseThrow(() -> new NoSuchElementException("No node found"));
}
Expand Down
Loading