1
0
mirror of synced 2026-08-05 09:47:05 +00:00

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:
Phillip Webb
2020-07-29 18:18:05 -07:00
committed by Rob Winch
parent 01d90c9881
commit 52f20b5281
426 changed files with 1668 additions and 1617 deletions
@@ -43,14 +43,14 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
protected void configure(
HttpSecurity http) throws Exception {
http
.authorizeRequests(authorizeRequests ->
.authorizeRequests((authorizeRequests) ->
authorizeRequests
.anyRequest().authenticated()
)
.formLogin(withDefaults())
.sessionManagement(sessionManagement ->
.sessionManagement((sessionManagement) ->
sessionManagement
.sessionConcurrency(sessionConcurrency ->
.sessionConcurrency((sessionConcurrency) ->
sessionConcurrency
.maximumSessions(1)
.expiredUrl("/login?expired")
@@ -30,17 +30,17 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests(authorizeRequests ->
.authorizeRequests((authorizeRequests) ->
authorizeRequests
.antMatchers("/resources/**").permitAll()
.anyRequest().authenticated()
)
.formLogin(formLogin ->
.formLogin((formLogin) ->
formLogin
.loginPage("/login")
.permitAll()
)
.logout(logout ->
.logout((logout) ->
logout
.permitAll()
);
@@ -32,64 +32,64 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests(authorizeRequests ->
.authorizeRequests((authorizeRequests) ->
authorizeRequests
.antMatchers("/resources/**").permitAll()
.anyRequest().authenticated()
)
.openidLogin(openidLogin ->
.openidLogin((openidLogin) ->
openidLogin
.loginPage("/login")
.permitAll()
.authenticationUserDetailsService(new CustomUserDetailsService())
.attributeExchange(googleExchange ->
.attributeExchange((googleExchange) ->
googleExchange
.identifierPattern("https://www.google.com/.*")
.attribute(emailAttribute ->
.attribute((emailAttribute) ->
emailAttribute
.name("email")
.type("https://axschema.org/contact/email")
.required(true)
)
.attribute(firstnameAttribute ->
.attribute((firstnameAttribute) ->
firstnameAttribute
.name("firstname")
.type("https://axschema.org/namePerson/first")
.required(true)
)
.attribute(lastnameAttribute ->
.attribute((lastnameAttribute) ->
lastnameAttribute
.name("lastname")
.type("https://axschema.org/namePerson/last")
.required(true)
)
)
.attributeExchange(yahooExchange ->
.attributeExchange((yahooExchange) ->
yahooExchange
.identifierPattern(".*yahoo.com.*")
.attribute(emailAttribute ->
.attribute((emailAttribute) ->
emailAttribute
.name("email")
.type("https://axschema.org/contact/email")
.required(true)
)
.attribute(fullnameAttribute ->
.attribute((fullnameAttribute) ->
fullnameAttribute
.name("fullname")
.type("https://axschema.org/namePerson")
.required(true)
)
)
.attributeExchange(myopenidExchange ->
.attributeExchange((myopenidExchange) ->
myopenidExchange
.identifierPattern(".*myopenid.com.*")
.attribute(emailAttribute ->
.attribute((emailAttribute) ->
emailAttribute
.name("email")
.type("https://schema.openid.net/contact/email")
.required(true)
)
.attribute(fullnameAttribute ->
.attribute((fullnameAttribute) ->
fullnameAttribute
.name("fullname")
.type("https://schema.openid.net/namePerson")
@@ -27,12 +27,12 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests(authorizeRequests ->
.authorizeRequests((authorizeRequests) ->
authorizeRequests
.antMatchers("/login", "/resources/**").permitAll()
.anyRequest().authenticated()
)
.jee(jee ->
.jee((jee) ->
jee
.mappableRoles("USER", "ADMIN")
);
@@ -42,12 +42,12 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests(authorizeRequests ->
.authorizeRequests((authorizeRequests) ->
authorizeRequests
.antMatchers("/resources/**").permitAll()
.anyRequest().authenticated()
)
.formLogin(formLogin ->
.formLogin((formLogin) ->
formLogin
.loginPage("/login")
.permitAll()
@@ -57,11 +57,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
return RelyingPartyRegistration.withRegistrationId(registrationId)
.entityId(localEntityIdTemplate)
.assertionConsumerServiceLocation(acsUrlTemplate)
.signingX509Credentials(c -> c.add(signingCredential))
.assertingPartyDetails(config -> config
.signingX509Credentials((c) -> c.add(signingCredential))
.assertingPartyDetails((config) -> config
.entityId(idpEntityId)
.singleSignOnServiceLocation(webSsoEndpoint)
.verificationX509Credentials(c -> c.add(idpVerificationCertificate)))
.verificationX509Credentials((c) -> c.add(idpVerificationCertificate)))
.build();
}
@@ -52,7 +52,7 @@ public class SecurityConfigTests {
Saml2WebSsoAuthenticationFilter filter = (Saml2WebSsoAuthenticationFilter) filters
.stream()
.filter(
f -> f instanceof Saml2WebSsoAuthenticationFilter
(f) -> f instanceof Saml2WebSsoAuthenticationFilter
)
.findFirst()
.get();
@@ -43,7 +43,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests(authorizeRequests ->
.authorizeRequests((authorizeRequests) ->
authorizeRequests
.anyRequest().authenticated()
)