Polish "Avoid using reflection when configuring Tomcat listener"

See gh-22329
This commit is contained in:
Andy Wilkinson
2020-07-15 11:19:52 +01:00
parent be7048b58f
commit 18a3459dc3
2 changed files with 6 additions and 10 deletions

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.
@@ -16,9 +16,8 @@
package org.springframework.boot.autoconfigure.websocket.reactive;
import java.util.Collections;
import org.apache.tomcat.websocket.server.WsSci;
import org.springframework.boot.web.embedded.tomcat.TomcatReactiveWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.core.Ordered;
@@ -34,8 +33,7 @@ public class TomcatWebSocketReactiveWebServerCustomizer
@Override
public void customize(TomcatReactiveWebServerFactory factory) {
factory.addContextCustomizers((context) ->
context.addServletContainerInitializer(new WsSci(), Collections.emptySet()));
factory.addContextCustomizers((context) -> context.addServletContainerInitializer(new WsSci(), null));
}
@Override

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.
@@ -16,9 +16,8 @@
package org.springframework.boot.autoconfigure.websocket.servlet;
import java.util.Collections;
import org.apache.tomcat.websocket.server.WsSci;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.core.Ordered;
@@ -36,8 +35,7 @@ public class TomcatWebSocketServletWebServerCustomizer
@Override
public void customize(TomcatServletWebServerFactory factory) {
factory.addContextCustomizers((context) ->
context.addServletContainerInitializer(new WsSci(), Collections.emptySet()));
factory.addContextCustomizers((context) -> context.addServletContainerInitializer(new WsSci(), null));
}
@Override