Merge pull request #5861 from eclipse/jetty-10.0.x-getMappings

Fix bad refactor of WebSocket getMappings method.
This commit is contained in:
Lachlan 2021-01-12 11:17:50 +11:00 committed by GitHub
commit 7aae1801e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -54,14 +54,14 @@ public class WebSocketMappings implements Dumpable, LifeCycle.Listener
private static final Logger LOG = LoggerFactory.getLogger(WebSocketMappings.class); private static final Logger LOG = LoggerFactory.getLogger(WebSocketMappings.class);
public static final String WEBSOCKET_MAPPING_ATTRIBUTE = WebSocketMappings.class.getName(); public static final String WEBSOCKET_MAPPING_ATTRIBUTE = WebSocketMappings.class.getName();
public static WebSocketMappings getWebSocketNegotiator(ServletContext servletContext) public static WebSocketMappings getMappings(ServletContext servletContext)
{ {
return (WebSocketMappings)servletContext.getAttribute(WEBSOCKET_MAPPING_ATTRIBUTE); return (WebSocketMappings)servletContext.getAttribute(WEBSOCKET_MAPPING_ATTRIBUTE);
} }
public static WebSocketMappings ensureMappings(ServletContext servletContext) public static WebSocketMappings ensureMappings(ServletContext servletContext)
{ {
WebSocketMappings mapping = getWebSocketNegotiator(servletContext); WebSocketMappings mapping = getMappings(servletContext);
if (mapping == null) if (mapping == null)
{ {
mapping = new WebSocketMappings(WebSocketServerComponents.getWebSocketComponents(servletContext)); mapping = new WebSocketMappings(WebSocketServerComponents.getWebSocketComponents(servletContext));