Skip to content

Commit fa01a15

Browse files
committed
Merge pull request #21130 from richard1230
* pr/21130: Polish contribution Polish Closes gh-21130
2 parents f85a088 + 4165863 commit fa01a15

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
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/logging/DeferredLog.java

Lines changed: 1 addition & 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.
@@ -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.Collections;
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+
Collections.addAll(connectors, 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)