Fixes #8975 - Rename getBaseResponse() to getServletContextResponse(). (#8976)

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2022-12-06 15:08:58 +01:00 committed by GitHub
parent ca3101814b
commit f8c4783802
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 10 deletions

View File

@ -98,7 +98,7 @@ public class JaspiMessageInfo implements MessageInfo
{
if (!(response instanceof ServletResponse))
throw new IllegalStateException("Not a ServletResponse");
_response = ServletContextResponse.getBaseResponse((ServletResponse)response);
_response = ServletContextResponse.getServletContextResponse((ServletResponse)response);
}
public String getAuthMethod()

View File

@ -740,7 +740,7 @@ public class DefaultServlet extends HttpServlet
{
_coreRequest = coreRequest;
_response = response;
_coreResponse = ServletContextResponse.getBaseResponse(response);
_coreResponse = ServletContextResponse.getServletContextResponse(response);
_httpFields = new HttpServletResponseHttpFields(response);
}

View File

@ -126,7 +126,7 @@ public class Dispatcher implements RequestDispatcher
{
HttpServletRequest httpRequest = (request instanceof HttpServletRequest) ? (HttpServletRequest)request : new ServletRequestHttpWrapper(request);
HttpServletResponse httpResponse = (response instanceof HttpServletResponse) ? (HttpServletResponse)response : new ServletResponseHttpWrapper(response);
ServletContextResponse baseResponse = ServletContextResponse.getBaseResponse(response);
ServletContextResponse servletContextResponse = ServletContextResponse.getServletContextResponse(response);
try
{
@ -134,7 +134,7 @@ public class Dispatcher implements RequestDispatcher
}
finally
{
baseResponse.included();
servletContextResponse.included();
}
}

View File

@ -85,7 +85,7 @@ public class ServletContextResponse extends ContextResponse
private long _contentLength = -1;
private Supplier<Map<String, String>> _trailers;
public static ServletContextResponse getBaseResponse(ServletResponse response)
public static ServletContextResponse getServletContextResponse(ServletResponse response)
{
if (response instanceof ServletApiResponse)
return ((ServletApiResponse)response).getResponse();
@ -98,7 +98,7 @@ public class ServletContextResponse extends ContextResponse
if (response instanceof ServletApiResponse)
return ((ServletApiResponse)response).getResponse();
return null;
throw new IllegalStateException("could not find %s for %s".formatted(ServletContextResponse.class.getSimpleName(), response));
}
public ServletContextResponse(ServletChannel servletChannel, ServletContextRequest request, Response response)

View File

@ -22,7 +22,6 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import jakarta.servlet.ServletException;
@ -34,8 +33,6 @@ import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
import org.eclipse.jetty.ee10.servlet.ServletContextResponse;
import org.eclipse.jetty.ee10.servlet.ServletHolder;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Response;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.util.StringUtil;
@ -243,7 +240,7 @@ public class OpenIdProvider extends ContainerLifeCycle
int redirectCode = (HttpVersion.fromString(request.getProtocol()).getVersion() < HttpVersion.HTTP_1_1.getVersion()
? HttpServletResponse.SC_MOVED_TEMPORARILY : HttpServletResponse.SC_SEE_OTHER);
ServletContextResponse.getBaseResponse(response).getServletApiResponse().sendRedirect(redirectCode, response.encodeRedirectURL(redirectUri));
ServletContextResponse.getServletContextResponse(response).getServletApiResponse().sendRedirect(redirectCode, response.encodeRedirectURL(redirectUri));
}
catch (Throwable t)
{