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:
+2
-2
@@ -70,11 +70,11 @@ public class HelloWebfluxMethodApplicationITests {
|
||||
}
|
||||
|
||||
private Consumer<HttpHeaders> robsCredentials() {
|
||||
return httpHeaders -> httpHeaders.setBasicAuth("rob", "rob");
|
||||
return (httpHeaders) -> httpHeaders.setBasicAuth("rob", "rob");
|
||||
}
|
||||
|
||||
private Consumer<HttpHeaders> adminCredentials() {
|
||||
return httpHeaders -> httpHeaders.setBasicAuth("admin", "admin");
|
||||
return (httpHeaders) -> httpHeaders.setBasicAuth("admin", "admin");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class SecurityConfig {
|
||||
return http
|
||||
// Demonstrate that method security works
|
||||
// Best practice to use both for defense in depth
|
||||
.authorizeExchange(exchanges -> exchanges
|
||||
.authorizeExchange((exchanges) -> exchanges
|
||||
.anyExchange().permitAll()
|
||||
)
|
||||
.httpBasic(withDefaults())
|
||||
|
||||
+2
-2
@@ -123,10 +123,10 @@ public class HelloWebfluxMethodApplicationTests {
|
||||
}
|
||||
|
||||
private Consumer<HttpHeaders> robsCredentials() {
|
||||
return httpHeaders -> httpHeaders.setBasicAuth("rob", "rob");
|
||||
return (httpHeaders) -> httpHeaders.setBasicAuth("rob", "rob");
|
||||
}
|
||||
|
||||
private Consumer<HttpHeaders> adminCredentials() {
|
||||
return httpHeaders -> httpHeaders.setBasicAuth("admin", "admin");
|
||||
return (httpHeaders) -> httpHeaders.setBasicAuth("admin", "admin");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user