Skip to content

Commit 12c5cdc

Browse files
committed
Merge branch '2.2.x'
Closes gh-19104
2 parents 6bbc3d1 + 36f4d2f commit 12c5cdc

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public void customize(JettyServletWebServerFactory factory) {
190190

191191
private void customizeServer(Server server) {
192192
RequestLog requestLog = server.getRequestLog();
193-
if (requestLog != null && requestLog instanceof CustomRequestLog) {
193+
if (requestLog instanceof CustomRequestLog) {
194194
customizeRequestLog((CustomRequestLog) requestLog);
195195
}
196196
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointMediaTypes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class EndpointMediaTypes {
5151
* @since 2.2.0
5252
*/
5353
public EndpointMediaTypes(String... producedAndConsumed) {
54-
this((producedAndConsumed != null) ? Arrays.asList(producedAndConsumed) : (List<String>) null);
54+
this((producedAndConsumed != null) ? Arrays.asList(producedAndConsumed) : null);
5555
}
5656

5757
/**

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ protected final <T> List<T> removeDuplicates(List<T> list) {
279279

280280
protected final List<String> asList(AnnotationAttributes attributes, String name) {
281281
String[] value = attributes.getStringArray(name);
282-
return Arrays.asList((value != null) ? value : new String[0]);
282+
return Arrays.asList(value);
283283
}
284284

285285
private void fireAutoConfigurationImportEvents(List<String> configurations, Set<String> exclusions) {

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnResourceCondition.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.springframework.context.annotation.ConditionContext;
2525
import org.springframework.core.Ordered;
2626
import org.springframework.core.annotation.Order;
27-
import org.springframework.core.io.DefaultResourceLoader;
2827
import org.springframework.core.io.ResourceLoader;
2928
import org.springframework.core.type.AnnotatedTypeMetadata;
3029
import org.springframework.util.Assert;
@@ -39,14 +38,11 @@
3938
@Order(Ordered.HIGHEST_PRECEDENCE + 20)
4039
class OnResourceCondition extends SpringBootCondition {
4140

42-
private final ResourceLoader defaultResourceLoader = new DefaultResourceLoader();
43-
4441
@Override
4542
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
4643
MultiValueMap<String, Object> attributes = metadata
4744
.getAllAnnotationAttributes(ConditionalOnResource.class.getName(), true);
48-
ResourceLoader loader = (context.getResourceLoader() != null) ? context.getResourceLoader()
49-
: this.defaultResourceLoader;
45+
ResourceLoader loader = context.getResourceLoader();
5046
List<String> locations = new ArrayList<>();
5147
collectValues(locations, attributes.get("resources"));
5248
Assert.isTrue(!locations.isEmpty(),

0 commit comments

Comments
 (0)