Skip to content

Commit c3678df

Browse files
committed
Merge pull request #21986 from dreis2211
* pr/21986: Use lazy lambda instead of explicit argument Closes gh-21986
2 parents ab51f3a + 855d596 commit c3678df

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/trace/http/HttpExchangeTracerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -318,7 +318,7 @@ static class RequestHeadersFilterHttpExchangeTracer extends HttpExchangeTracer {
318318
@Override
319319
protected void postProcessRequestHeaders(Map<String, List<String>> headers) {
320320
headers.remove("to-remove");
321-
headers.putIfAbsent("to-add", Collections.singletonList("42"));
321+
headers.computeIfAbsent("to-add", (key) -> Collections.singletonList("42"));
322322
}
323323

324324
}

spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/webservices/client/WebServiceClientExcludeFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public final class WebServiceClientExcludeFilter
3636

3737
protected WebServiceClientExcludeFilter(Class<?> testClass) {
3838
super(testClass);
39-
this.components = getAnnotation().getValue("components", Class[].class).orElse(new Class[0]);
39+
this.components = getAnnotation().getValue("components", Class[].class).orElseGet(() -> new Class<?>[0]);
4040
}
4141

4242
@Override

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/result/view/MustacheView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -84,7 +84,7 @@ protected Mono<Void> renderInternal(Map<String, Object> model, MediaType content
8484
DataBuffer dataBuffer = exchange.getResponse().bufferFactory().allocateBuffer();
8585
try (Reader reader = getReader(resource)) {
8686
Template template = this.compiler.compile(reader);
87-
Charset charset = getCharset(contentType).orElse(getDefaultCharset());
87+
Charset charset = getCharset(contentType).orElseGet(this::getDefaultCharset);
8888
try (Writer writer = new OutputStreamWriter(dataBuffer.asOutputStream(), charset)) {
8989
template.execute(model, writer);
9090
writer.flush();

0 commit comments

Comments
 (0)