Skip to content

Fix code smell in websocket and webflux modules #2669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 19, 2018

Conversation

artembilan
Copy link
Member

No description provided.

@garyrussell
Copy link
Contributor

Travis reports a checkstyle problem.

@@ -39,6 +40,7 @@

@Override
public boolean supports(HandlerResult result) {
Assert.notNull(result, "'result' must not be null");
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need this assert; Spring will never call this with a null result.

@@ -47,6 +49,7 @@ public boolean supports(HandlerResult result) {
@Override
@SuppressWarnings("unchecked")
public Mono<Void> handleResult(ServerWebExchange exchange, HandlerResult result) {
Assert.notNull(result, "'result' must not be null");
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is the reported issue; the problem is result.getReturnValue() can return null, which is not allowed by the handleResult contract.

@garyrussell garyrussell merged commit 8ce8bf9 into spring-projects:master Dec 19, 2018
@artembilan artembilan deleted the sonar branch December 19, 2018 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants