Polish contribution

See gh-21130
This commit is contained in:
Stephane Nicoll
2020-04-27 10:41:02 +02:00
parent a989879dbc
commit 4165863859
3 changed files with 7 additions and 4 deletions

View File

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

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

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