Merge pull request #22211 from XenoAmess

* gh-22211:
  Polish "Use new ArrayList(Collection) rather than new and addAll"
  Use new ArrayList(Collection) rather than new and addAll

Closes gh-22211
pull/22256/head
Andy Wilkinson 4 years ago
commit eb56bb5797

@ -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>();
factories.addAll(Arrays.asList(initialHttpHandlerFactories));
List<HttpHandlerFactory> factories = new ArrayList<>(Arrays.asList(initialHttpHandlerFactories));
if (compression != null && compression.getEnabled()) {
factories.add(new CompressionHttpHandlerFactory(compression));
}

Loading…
Cancel
Save