Browse Source

Polish "Use new ArrayList(Collection) rather than new and addAll"

See gh-22211
pull/22256/head
Andy Wilkinson 6 years ago
parent
commit
cd8081f952
  1. 3
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowWebServerFactoryDelegate.java

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

@ -189,8 +189,7 @@ class UndertowWebServerFactoryDelegate { @@ -189,8 +189,7 @@ class UndertowWebServerFactoryDelegate {
static List<HttpHandlerFactory> createHttpHandlerFactories(Compression compression, boolean useForwardHeaders,
String serverHeader, Shutdown shutdown, HttpHandlerFactory... initialHttpHandlerFactories) {
List<HttpHandlerFactory> factories =
new ArrayList<HttpHandlerFactory>(Arrays.asList(initialHttpHandlerFactories));
List<HttpHandlerFactory> factories = new ArrayList<>(Arrays.asList(initialHttpHandlerFactories));
if (compression != null && compression.getEnabled()) {
factories.add(new CompressionHttpHandlerFactory(compression));
}

Loading…
Cancel
Save