Skip to content

Commit

Permalink
Write down current thinking
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Nov 3, 2024
1 parent 374db08 commit f7b1121
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1772,9 +1772,15 @@ StepVerifier.FirstStep<? extends T> after(Flux<T> flux) {
* Prefer {@link StepVerifier.LastStep#verify()} over a dangling {@link
* StepVerifier#verifyThenAssertThat()}.
*/
// XXX: This rule may break existing code. We want to explicitly nudge towards using {@link
// StepVerifier.Step#assertNext(Consumer)} or {@link StepVerifier.Step#expectNext(Object)}
// together with {@link Step#verifyComplete()}.
// XXX: Application of this rule (and several others in this class) will cause invalid code if the
// result of the rewritten expression is dereferenced. Consider introducing a bug checker that
// identifies rules that change the return type of an expression and annotates them accordingly.
// The associated annotation can then be used to instruct an annotation processor to generate
// corresponding `void` rules that match only statements. This would allow the `Refaster` check to
// conditionally skip "not fully safe" rules. This allows conditionally flagging more dubious
// code, at the risk of compilation failures. With this rule, for example, we want to explicitly
// nudge users towards `StepVerifier.Step#assertNext(Consumer)` or
// `StepVerifier.Step#expectNext(Object)`, together with `Step#verifyComplete()`.
static final class StepVerifierVerify {
@BeforeTemplate
StepVerifier.Assertions before(StepVerifier stepVerifier) {
Expand Down

0 comments on commit f7b1121

Please sign in to comment.