Skip to content

Commit

Permalink
Merge pull request #114 from jenkinsci/merge-api
Browse files Browse the repository at this point in the history
Restore old API for `merge`
  • Loading branch information
uhafner authored Jun 7, 2024
2 parents a9dad65 + 767d01a commit 83a2b88
Showing 1 changed file with 2 additions and 1 deletion.
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 @@ private String createTargetClassName(final ClassNode testClassNode) {
*
* @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 @@ public static Node merge(final List<Node> nodes) {

if (grouped.size() == 1) {
return nodes.stream()
.map(Node.class::cast)
.reduce(Node::merge)
.orElseThrow(() -> new NoSuchElementException("No node found"));

Check warning on line 712 in src/main/java/edu/hm/hafner/coverage/Node.java

View workflow job for this annotation

GitHub Actions / Quality Monitor

Not covered line

Line 712 is not covered by tests
}
Expand Down

0 comments on commit 83a2b88

Please sign in to comment.