Commit 41658638 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish contribution

See gh-21130
parent a989879d
...@@ -117,7 +117,10 @@ class ValueObjectBinder implements DataObjectBinder { ...@@ -117,7 +117,10 @@ class ValueObjectBinder implements DataObjectBinder {
} }
private boolean isEmptyDefaultValueAllowed(Class<?> type) { 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) { private boolean isAggregate(Class<?> type) {
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
......
...@@ -18,7 +18,7 @@ package org.springframework.boot.web.embedded.tomcat; ...@@ -18,7 +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.Collections;
import java.util.List; import java.util.List;
import org.apache.catalina.Container; import org.apache.catalina.Container;
...@@ -107,7 +107,7 @@ class TomcatGracefulShutdown implements GracefulShutdown { ...@@ -107,7 +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()) {
connectors.addAll(Arrays.asList(service.findConnectors())); Collections.addAll(connectors, service.findConnectors());
} }
return connectors; return connectors;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment