Use new ArrayList(Collection) rather than new and addAll

See gh-22211
pull/22256/head
XenoAmess 4 years ago committed by Andy Wilkinson
parent 54ce2905af
commit fb70c529d4

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

Loading…
Cancel
Save