Skip to content

Commit

Permalink
Merge pull request #1489 from smallrye/fix/concatmap-rewrite
Browse files Browse the repository at this point in the history
fix: rewrite the concatMap operator
  • Loading branch information
jponge committed Jan 18, 2024
2 parents 461a200 + dded2d6 commit 0adf52a
Show file tree
Hide file tree
Showing 4 changed files with 239 additions and 195 deletions.
9 changes: 8 additions & 1 deletion implementation/revapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@
"criticality" : "highlight",
"minSeverity" : "POTENTIALLY_BREAKING",
"minCriticality" : "documented",
"differences" : [ ]
"differences" : [
{
"ignore": true,
"code": "java.class.removed",
"old": "class io.smallrye.mutiny.operators.multi.MultiConcatMapOp.ConcatMapMainSubscriber<I, O>",
"justification": "Refactoring of internal APIs"
}
]
}
}, {
"extension" : "revapi.reporter.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,13 @@ public <O> Multi<O> transformToIterable(Function<? super T, ? extends Iterable<O
@CheckReturnValue
public <O> MultiFlatten<T, O> transformToUni(Function<? super T, Uni<? extends O>> mapper) {
Function<? super T, Uni<? extends O>> actual = Infrastructure.decorate(nonNull(mapper, "mapper"));
Function<? super T, ? extends Publisher<? extends O>> wrapper = res -> actual.apply(res).toMulti();
Function<? super T, ? extends Publisher<? extends O>> wrapper = res -> {
Uni<? extends O> uni = actual.apply(res);
if (uni == null) {
return Multi.createFrom().failure(new NullPointerException(MAPPER_RETURNED_NULL));
}
return uni.toMulti();
};
return new MultiFlatten<>(upstream, wrapper, 1, false);
}

Expand Down

0 comments on commit 0adf52a

Please sign in to comment.