Use parenthesis with single-arg lambdas
Use regular expression search/replace to ensure all single-arg lambdas have parenthesis. This aligns with the style used in Spring Boot and ensure that single-arg and multi-arg lambdas are consistent. Issue gh-8945
This commit is contained in:
@@ -75,10 +75,10 @@ public class HelloWebfluxFnApplicationITests {
|
||||
}
|
||||
|
||||
private Consumer<HttpHeaders> userCredentials() {
|
||||
return httpHeaders -> httpHeaders.setBasicAuth("user", "user");
|
||||
return (httpHeaders) -> httpHeaders.setBasicAuth("user", "user");
|
||||
}
|
||||
|
||||
private Consumer<HttpHeaders> invalidCredentials() {
|
||||
return httpHeaders -> httpHeaders.setBasicAuth("user", "INVALID");
|
||||
return (httpHeaders) -> httpHeaders.setBasicAuth("user", "INVALID");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class HelloUserController {
|
||||
public Mono<ServerResponse> hello(ServerRequest serverRequest) {
|
||||
return serverRequest.principal()
|
||||
.map(Principal::getName)
|
||||
.flatMap(username ->
|
||||
.flatMap((username) ->
|
||||
ServerResponse.ok()
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.syncBody(Collections.singletonMap("message", "Hello " + username + "!"))
|
||||
|
||||
@@ -106,10 +106,10 @@ public class HelloWebfluxFnApplicationTests {
|
||||
}
|
||||
|
||||
private Consumer<HttpHeaders> userCredentials() {
|
||||
return httpHeaders -> httpHeaders.setBasicAuth("user", "user");
|
||||
return (httpHeaders) -> httpHeaders.setBasicAuth("user", "user");
|
||||
}
|
||||
|
||||
private Consumer<HttpHeaders> invalidCredentials() {
|
||||
return httpHeaders -> httpHeaders.setBasicAuth("user", "INVALID");
|
||||
return (httpHeaders) -> httpHeaders.setBasicAuth("user", "INVALID");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user