Skip to content

Commit 4165863

Browse files
committed
Polish contribution
See gh-21130
1 parent a989879 commit 4165863

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/ValueObjectBinder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ private <T> T getNewInstanceIfPossible(Binder.Context context, ResolvableType ty
117117
}
118118

119119
private boolean isEmptyDefaultValueAllowed(Class<?> type) {
120-
return !type.isPrimitive() && !type.isEnum() && !isAggregate(type) && !type.getName().startsWith("java.lang");
120+
if (type.isPrimitive() || type.isEnum() || isAggregate(type) || type.getName().startsWith("java.lang")) {
121+
return false;
122+
}
123+
return true;
121124
}
122125

123126
private boolean isAggregate(Class<?> type) {

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java

Lines changed: 1 addition & 1 deletion
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.

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatGracefulShutdown.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import java.time.Duration;
2020
import java.util.ArrayList;
21-
import java.util.Arrays;
21+
import java.util.Collections;
2222
import java.util.List;
2323

2424
import org.apache.catalina.Container;
@@ -107,7 +107,7 @@ private boolean active(Container context) {
107107
private List<Connector> getConnectors() {
108108
List<Connector> connectors = new ArrayList<>();
109109
for (Service service : this.tomcat.getServer().findServices()) {
110-
connectors.addAll(Arrays.asList(service.findConnectors()));
110+
Collections.addAll(connectors, service.findConnectors());
111111
}
112112
return connectors;
113113
}

0 commit comments

Comments
 (0)