See gh-21130
pull/21207/head
richard1230 5 years ago committed by Stephane Nicoll
parent f85a0884ab
commit a989879dbc

@ -149,7 +149,7 @@ public enum CloudPlatform {
*/ */
public boolean isEnforced(Environment environment) { public boolean isEnforced(Environment environment) {
String platform = environment.getProperty("spring.main.cloud-platform"); String platform = environment.getProperty("spring.main.cloud-platform");
return (platform != null) ? name().equalsIgnoreCase(platform) : false; return name().equalsIgnoreCase(platform);
} }
/** /**

@ -117,10 +117,7 @@ class ValueObjectBinder implements DataObjectBinder {
} }
private boolean isEmptyDefaultValueAllowed(Class<?> type) { private boolean isEmptyDefaultValueAllowed(Class<?> type) {
if (type.isPrimitive() || type.isEnum() || isAggregate(type) || type.getName().startsWith("java.lang")) { return !type.isPrimitive() && !type.isEnum() && !isAggregate(type) && !type.getName().startsWith("java.lang");
return false;
}
return true;
} }
private boolean isAggregate(Class<?> type) { private boolean isAggregate(Class<?> type) {

@ -232,7 +232,6 @@ public class DeferredLog implements Log {
return; return;
case FATAL: case FATAL:
log.fatal(message, throwable); log.fatal(message, throwable);
return;
} }
} }

@ -18,6 +18,7 @@ package org.springframework.boot.web.embedded.tomcat;
import java.time.Duration; import java.time.Duration;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import org.apache.catalina.Container; import org.apache.catalina.Container;
@ -106,9 +107,7 @@ class TomcatGracefulShutdown implements GracefulShutdown {
private List<Connector> getConnectors() { private List<Connector> getConnectors() {
List<Connector> connectors = new ArrayList<>(); List<Connector> connectors = new ArrayList<>();
for (Service service : this.tomcat.getServer().findServices()) { for (Service service : this.tomcat.getServer().findServices()) {
for (Connector connector : service.findConnectors()) { connectors.addAll(Arrays.asList(service.findConnectors()));
connectors.add(connector);
}
} }
return connectors; return connectors;
} }

@ -251,11 +251,11 @@ public class UndertowWebServer implements WebServer {
@Override @Override
public boolean shutDownGracefully() { public boolean shutDownGracefully() {
return (this.gracefulShutdown != null) ? this.gracefulShutdown.shutDownGracefully() : false; return (this.gracefulShutdown != null) && this.gracefulShutdown.shutDownGracefully();
} }
boolean inGracefulShutdown() { boolean inGracefulShutdown() {
return (this.gracefulShutdown != null) ? this.gracefulShutdown.isShuttingDown() : false; return (this.gracefulShutdown != null) && this.gracefulShutdown.isShuttingDown();
} }
/** /**

Loading…
Cancel
Save