eclipse / microprofile-reactive-streams-operators

Microprofile project
Apache License 2.0
79 stars 33 forks source link

Null expectation of flatMapCompletionStage & Stage.FlatMapCompletionStage #135

Closed akarnokd closed 3 years ago

akarnokd commented 4 years ago

The documentation of ...Builder.flatMapCompletionStage and Stage.FlatMapCompletionStage don't describe what to do when the mapped-in CompletionStage signals null, unlike ReactiveStreamsFactory.fromCompletionStageNullable.

Since there is no flatMapCompletionStageNullable in the API, it is unclear to me if the equivalent throwing behavior should be provided or not.

What is the expected behavior?

Emily-Jiang commented 4 years ago

@cescoffier can you clarify what is the expected behaviour?

cescoffier commented 4 years ago

The current behavior would produce a failure. It's very inconvenient I would say.

Emily-Jiang commented 4 years ago

Document that this method will throw NPE when null is passed in.