Skip to content

doc: proceed with RequestFilter and CompletableFuture#11285

Merged
sdelamo merged 7 commits into4.7.xfrom
doc-request-filter-completeablefuture-proceed
Oct 30, 2024
Merged

doc: proceed with RequestFilter and CompletableFuture#11285
sdelamo merged 7 commits into4.7.xfrom
doc-request-filter-completeablefuture-proceed

Conversation

@sdelamo
Copy link
Contributor

@sdelamo sdelamo commented Oct 29, 2024

No description provided.

//tag::methods[]
@RequestFilter
@Nullable
public CompletableFuture<@Nullable HttpResponse<?>> filter(@NonNull HttpRequest<?> request) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that if you remove the @Nullable annotation. It does not work. This PR ensures the users finds the correct return type incantation. He needs to use CompletableFuture<@Nullable HttpResponse<?>> not CompletableFuture<HttpResponse<?>>.

Suggested change
public CompletableFuture<@Nullable HttpResponse<?>> filter(@NonNull HttpRequest<?> request) {
public CompletableFuture<HttpResponse<?>> filter(@NonNull HttpRequest<?> request) {

@sdelamo sdelamo force-pushed the doc-request-filter-completeablefuture-proceed branch from 4ac939d to 5cd988a Compare October 29, 2024 06:29
…ts/filter/RequestFilterCompletableFutureFutureProceedTest.java
@dstepanov
Copy link
Contributor

It should be also possible to use CompletionStage

@sdelamo
Copy link
Contributor Author

sdelamo commented Oct 29, 2024

It should be also possible to use CompletionStage

Documented and I added a test of CompletionStage

…ts/filter/RequestFilterCompletionStageFutureProceedTest.java
@sonarqubecloud
Copy link

@sdelamo sdelamo merged commit c233fcb into 4.7.x Oct 30, 2024
@sdelamo sdelamo deleted the doc-request-filter-completeablefuture-proceed branch October 30, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants