Skip to content

Commit c43afbf

Browse files
committed
Format Lambda Expressions
This commit updats lambda expressions so that their variable is surrounded in parentheses. Issue gh-13067
1 parent 20a2213 commit c43afbf

File tree

45 files changed

+272
-272
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+272
-272
lines changed

buildSrc/src/main/groovy/io/spring/gradle/convention/ManagementConfigurationPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void apply(Project project) {
6161
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
6262
publishing.getPublications().withType(MavenPublication.class, (mavenPublication -> {
6363
mavenPublication.versionMapping((versions) ->
64-
versions.allVariants(versionMapping -> versionMapping.fromResolutionResult())
64+
versions.allVariants((versionMapping) -> versionMapping.fromResolutionResult())
6565
);
6666
}));
6767
});
@@ -71,4 +71,4 @@ public void apply(Project project) {
7171
}));
7272
});
7373
}
74-
}
74+
}

buildSrc/src/main/java/org/springframework/security/CheckExpectedBranchVersionPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void apply(Project project) {
4646
task.setDescription("Check if the project version matches the branch version");
4747
task.onlyIf("skipCheckExpectedBranchVersion property is false or not present", CheckExpectedBranchVersionPlugin::skipPropertyFalseOrNotPresent);
4848
task.getVersion().convention(project.provider(() -> project.getVersion().toString()));
49-
task.getBranchName().convention(project.getProviders().exec(execSpec -> execSpec.setCommandLine("git", "symbolic-ref", "--short", "HEAD")).getStandardOutput().getAsText());
49+
task.getBranchName().convention(project.getProviders().exec((execSpec) -> execSpec.setCommandLine("git", "symbolic-ref", "--short", "HEAD")).getStandardOutput().getAsText());
5050
task.getOutputFile().convention(project.getLayout().getBuildDirectory().file("check-expected-branch-version"));
5151
});
5252
project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME, checkTask -> checkTask.dependsOn(checkExpectedBranchVersionTask));

docs/modules/ROOT/pages/features/authentication/password-storage.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ Java::
615615
@Bean
616616
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
617617
http
618-
.authorizeHttpRequests(authorize -> authorize
618+
.authorizeHttpRequests((authorize) -> authorize
619619
.anyRequest().authenticated()
620620
)
621621
.formLogin((login) -> login

docs/modules/ROOT/pages/reactive/authorization/authorize-http-requests.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Java::
1515
@Bean
1616
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
1717
http
18-
.authorizeExchange(exchanges -> exchanges
18+
.authorizeExchange((exchanges) -> exchanges
1919
.anyExchange().authenticated()
2020
)
2121
.httpBasic(withDefaults())

docs/modules/ROOT/pages/reactive/authorization/method.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ public class SecurityConfig {
614614
return http
615615
// Demonstrate that method security works
616616
// Best practice to use both for defense in depth
617-
.authorizeExchange(exchanges -> exchanges
617+
.authorizeExchange((exchanges) -> exchanges
618618
.anyExchange().permitAll()
619619
)
620620
.httpBasic(withDefaults())

docs/modules/ROOT/pages/reactive/configuration/webflux.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public class HelloWebfluxSecurityConfig {
8787
@Bean
8888
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
8989
http
90-
.authorizeExchange(exchanges -> exchanges
90+
.authorizeExchange((exchanges) -> exchanges
9191
.anyExchange().authenticated()
9292
)
9393
.httpBasic(withDefaults())

docs/modules/ROOT/pages/reactive/exploits/csrf.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Java::
4545
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
4646
http
4747
// ...
48-
.csrf(csrf -> csrf.csrfTokenRepository(CookieServerCsrfTokenRepository.withHttpOnlyFalse()))
48+
.csrf((csrf) -> csrf.csrfTokenRepository(CookieServerCsrfTokenRepository.withHttpOnlyFalse()))
4949
return http.build();
5050
}
5151
-----
@@ -91,7 +91,7 @@ Java::
9191
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
9292
http
9393
// ...
94-
.csrf(csrf -> csrf.disable()))
94+
.csrf((csrf) -> csrf.disable()))
9595
return http.build();
9696
}
9797
----
@@ -133,7 +133,7 @@ Java::
133133
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
134134
http
135135
// ...
136-
.csrf(csrf -> csrf
136+
.csrf((csrf) -> csrf
137137
.csrfTokenRequestHandler(new ServerCsrfTokenRequestAttributeHandler())
138138
)
139139
return http.build();
@@ -181,7 +181,7 @@ public class SecurityControllerAdvice {
181181
@ModelAttribute
182182
Mono<CsrfToken> csrfToken(ServerWebExchange exchange) {
183183
Mono<CsrfToken> csrfToken = exchange.getAttribute(CsrfToken.class.getName());
184-
return csrfToken.doOnSuccess(token -> exchange.getAttributes()
184+
return csrfToken.doOnSuccess((token) -> token.getAttributes()
185185
.put(CsrfRequestDataValueProcessor.DEFAULT_CSRF_ATTR_NAME, token));
186186
}
187187
}
@@ -351,7 +351,7 @@ Java::
351351
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
352352
http
353353
// ...
354-
.logout(logout -> logout.requiresLogout(new PathPatternParserServerWebExchangeMatcher("/logout")))
354+
.logout((logout) -> logout.requiresLogout(new PathPatternParserServerWebExchangeMatcher("/logout")))
355355
return http.build();
356356
}
357357
----
@@ -416,7 +416,7 @@ Java::
416416
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
417417
http
418418
// ...
419-
.csrf(csrf -> csrf.tokenFromMultipartDataEnabled(true))
419+
.csrf((csrf) -> csrf.tokenFromMultipartDataEnabled(true))
420420
return http.build();
421421
}
422422
----

docs/modules/ROOT/pages/reactive/exploits/headers.adoc

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Java::
2626
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
2727
http
2828
// ...
29-
.headers(headers -> headers
30-
.frameOptions(frameOptions -> frameOptions
29+
.headers((headers) -> headers
30+
.frameOptions((frameOptions) -> frameOptions
3131
.mode(Mode.SAMEORIGIN)
3232
)
3333
);
@@ -67,7 +67,7 @@ Java::
6767
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
6868
http
6969
// ...
70-
.headers(headers -> headers.disable());
70+
.headers((headers) -> headers.disable());
7171
return http.build();
7272
}
7373
----
@@ -112,8 +112,8 @@ Java::
112112
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
113113
http
114114
// ...
115-
.headers(headers -> headers
116-
.cache(cache -> cache.disable())
115+
.headers((headers) -> headers
116+
.cache((cache) -> cache.disable())
117117
);
118118
return http.build();
119119
}
@@ -154,8 +154,8 @@ Java::
154154
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
155155
http
156156
// ...
157-
.headers(headers -> headers
158-
.contentTypeOptions(contentTypeOptions -> contentTypeOptions.disable())
157+
.headers((headers) -> headers
158+
.contentTypeOptions((contentTypeOptions) -> contentTypeOptions.disable())
159159
);
160160
return http.build();
161161
}
@@ -196,8 +196,8 @@ Java::
196196
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
197197
http
198198
// ...
199-
.headers(headers -> headers
200-
.hsts(hsts -> hsts
199+
.headers((headers) -> headers
200+
.hsts((hsts) -> hsts
201201
.includeSubdomains(true)
202202
.preload(true)
203203
.maxAge(Duration.ofDays(365))
@@ -244,8 +244,8 @@ Java::
244244
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
245245
http
246246
// ...
247-
.headers(headers -> headers
248-
.frameOptions(frameOptions -> frameOptions
247+
.headers((headers) -> headers
248+
.frameOptions((frameOptions) -> frameOptions
249249
.mode(SAMEORIGIN)
250250
)
251251
);
@@ -287,8 +287,8 @@ Java::
287287
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
288288
http
289289
// ...
290-
.headers(headers -> headers
291-
.xssProtection(xssProtection -> xssProtection.disable())
290+
.headers((headers) -> headers
291+
.xssProtection((xssProtection) -> xssProtection.disable())
292292
);
293293
return http.build();
294294
}
@@ -325,8 +325,8 @@ Java::
325325
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
326326
http
327327
// ...
328-
.headers(headers -> headers
329-
.xssProtection(xssProtection -> xssProtection.headerValue(XXssProtectionServerHttpHeadersWriter.HeaderValue.ENABLED_MODE_BLOCK))
328+
.headers((headers) -> headers
329+
.xssProtection((xssProtection) -> xssProtection.headerValue(XXssProtectionServerHttpHeadersWriter.HeaderValue.ENABLED_MODE_BLOCK))
330330
);
331331
return http.build();
332332
}
@@ -376,8 +376,8 @@ Java::
376376
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
377377
http
378378
// ...
379-
.headers(headers -> headers
380-
.contentSecurityPolicy(policy -> policy
379+
.headers((headers) -> headers
380+
.contentSecurityPolicy((policy) -> policy
381381
.policyDirectives("script-src 'self' https://trustedscripts.example.com; object-src https://trustedplugins.example.com; report-uri /csp-report-endpoint/")
382382
)
383383
);
@@ -416,8 +416,8 @@ Java::
416416
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
417417
http
418418
// ...
419-
.headers(headers -> headers
420-
.contentSecurityPolicy(policy -> policy
419+
.headers((headers) -> headers
420+
.contentSecurityPolicy((policy) -> policy
421421
.policyDirectives("script-src 'self' https://trustedscripts.example.com; object-src https://trustedplugins.example.com; report-uri /csp-report-endpoint/")
422422
.reportOnly()
423423
)
@@ -462,8 +462,8 @@ Java::
462462
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
463463
http
464464
// ...
465-
.headers(headers -> headers
466-
.referrerPolicy(referrer -> referrer
465+
.headers((headers) -> headers
466+
.referrerPolicy((referrer) -> referrer
467467
.policy(ReferrerPolicy.SAME_ORIGIN)
468468
)
469469
);
@@ -515,7 +515,7 @@ Java::
515515
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
516516
http
517517
// ...
518-
.headers(headers -> headers
518+
.headers((headers) -> headers
519519
.featurePolicy("geolocation 'self'")
520520
);
521521
return http.build();
@@ -564,8 +564,8 @@ Java::
564564
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
565565
http
566566
// ...
567-
.headers(headers -> headers
568-
.permissionsPolicy(permissions -> permissions
567+
.headers((headers) -> headers
568+
.permissionsPolicy((permissions) -> permissions
569569
.policy("geolocation=(self)")
570570
)
571571
);

docs/modules/ROOT/pages/reactive/exploits/http.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ Java::
5757
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
5858
http
5959
// ...
60-
.redirectToHttps(redirect -> redirect
61-
.httpsRedirectWhen(e -> e.getRequest().getHeaders().containsKey("X-Forwarded-Proto"))
60+
.redirectToHttps((redirect) -> redirect
61+
.httpsRedirectWhen((e) -> e.getRequest().getHeaders().containsKey("X-Forwarded-Proto"))
6262
);
6363
return http.build();
6464
}

docs/modules/ROOT/pages/reactive/integrations/cors.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Java::
5555
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
5656
http
5757
// ...
58-
.cors(cors -> cors.disable());
58+
.cors((cors) -> cors.disable());
5959
return http.build();
6060
}
6161
----

0 commit comments

Comments
 (0)