Skip to content

Commit a989879

Browse files
richard1230snicoll
authored andcommitted
Polish
See gh-21130
1 parent f85a088 commit a989879

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/cloud/CloudPlatform.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public boolean isActive(Environment environment) {
149149
*/
150150
public boolean isEnforced(Environment environment) {
151151
String platform = environment.getProperty("spring.main.cloud-platform");
152-
return (platform != null) ? name().equalsIgnoreCase(platform) : false;
152+
return name().equalsIgnoreCase(platform);
153153
}
154154

155155
/**

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

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

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

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

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ private static void logTo(Log log, LogLevel level, Object message, Throwable thr
232232
return;
233233
case FATAL:
234234
log.fatal(message, throwable);
235-
return;
236235
}
237236
}
238237

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

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

1919
import java.time.Duration;
2020
import java.util.ArrayList;
21+
import java.util.Arrays;
2122
import java.util.List;
2223

2324
import org.apache.catalina.Container;
@@ -106,9 +107,7 @@ private boolean active(Container context) {
106107
private List<Connector> getConnectors() {
107108
List<Connector> connectors = new ArrayList<>();
108109
for (Service service : this.tomcat.getServer().findServices()) {
109-
for (Connector connector : service.findConnectors()) {
110-
connectors.add(connector);
111-
}
110+
connectors.addAll(Arrays.asList(service.findConnectors()));
112111
}
113112
return connectors;
114113
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ public int getPort() {
251251

252252
@Override
253253
public boolean shutDownGracefully() {
254-
return (this.gracefulShutdown != null) ? this.gracefulShutdown.shutDownGracefully() : false;
254+
return (this.gracefulShutdown != null) && this.gracefulShutdown.shutDownGracefully();
255255
}
256256

257257
boolean inGracefulShutdown() {
258-
return (this.gracefulShutdown != null) ? this.gracefulShutdown.isShuttingDown() : false;
258+
return (this.gracefulShutdown != null) && this.gracefulShutdown.isShuttingDown();
259259
}
260260

261261
/**

0 commit comments

Comments
 (0)