Skip to content

Commit

Permalink
Fixes #4236 - Cleanup various bits (#4237)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnriem authored Nov 21, 2024
1 parent ab13ae1 commit 6975429
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public String changeSessionId(HttpServletRequest request) {
}

@Override
@SuppressWarnings({"deprecation", "removal"})
@SuppressWarnings({"removal"})
public synchronized HttpSession createSession(HttpServletRequest request) {
String sessionId = UUID.randomUUID().toString();
DefaultHttpSession session = new DefaultHttpSession(webApplication, sessionId, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
*
* @author Manfred Riem ([email protected])
*/
@SuppressWarnings("deprecation")
public class DefaultPushBuilder implements PushBuilder {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,17 +352,6 @@ public void include(ServletRequest servletRequest, ServletResponse servletRespon
}
}

private ServletRequestWrapper getLastWrapper(ServletRequestWrapper wrapper) {
ServletRequestWrapper currentWrapper = wrapper;
ServletRequest currentRequest = wrapper;
while (currentRequest instanceof ServletRequestWrapper wrapped) {
currentWrapper = wrapped;
currentRequest = currentWrapper.getRequest();
}

return currentWrapper;
}

/**
* Send an error response.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ private void writeContentType() throws IOException {
* @param cookie the cookie.
* @throws IOException when an I/O error occurs.
*/
@SuppressWarnings({"deprecation", "removal"})
@SuppressWarnings({"removal"})
private void writeCookie(Cookie cookie) throws IOException {
outputStream.write("Set-Cookie: ".getBytes());
outputStream.write(cookie.getName().getBytes());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void parseMultipleCookies() {
*/

@Nested
@SuppressWarnings({"deprecation", "removal"})
@SuppressWarnings({"removal"})
class Netscape {
@Test
void parseSingleCookie() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,15 @@
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletInputStream;
import jakarta.servlet.ServletOutputStream;
import jakarta.servlet.ServletRegistration;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import jakarta.servlet.http.HttpUpgradeHandler;
import jakarta.servlet.http.WebConnection;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.util.Enumeration;
Expand Down Expand Up @@ -855,6 +852,7 @@ void testLogout() {
/**
* Test newPushBuilder method.
*/
@SuppressWarnings("deprecation")
@Test
void testNewPushBuilder() {
DefaultWebApplicationRequest request = new DefaultWebApplicationRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ void testGetAttributeNames() {
/**
* Test getCookies method.
*/
@SuppressWarnings({"deprecation", "removal"})
@SuppressWarnings({"removal"})
@Test
void testGetCookies() {
DefaultWebApplication webApplication = new DefaultWebApplication();
Expand Down Expand Up @@ -602,7 +602,7 @@ void testSetMaxInactiveInterval() {
*/
public static class TestSetCommentListener implements ServletContextListener {

@SuppressWarnings({"deprecation", "removal"})
@SuppressWarnings({"removal"})
@Override
public void contextInitialized(ServletContextEvent event) {
event.getServletContext().getSessionCookieConfig().setComment("MY COMMENT");
Expand All @@ -615,7 +615,7 @@ public void contextInitialized(ServletContextEvent event) {
*/
public static class TestSetCommentServlet extends HttpServlet {

@SuppressWarnings({"deprecation", "removal"})
@SuppressWarnings({"removal"})
@Override
protected void service(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
Expand Down Expand Up @@ -824,7 +824,7 @@ void testIsSecure() {
*
* @throws Exception when a serious error occurs.
*/
@SuppressWarnings({"deprecation", "removal"})
@SuppressWarnings({"removal"})
@Test
void testSetComment() throws Exception {
DefaultWebApplication webApplication = new DefaultWebApplication();
Expand All @@ -836,7 +836,7 @@ void testSetComment() throws Exception {
/**
* Test setComment.
*/
@SuppressWarnings({"deprecation", "removal"})
@SuppressWarnings({"removal"})
@Test
void testSetComment2() throws Exception {
DefaultWebApplication webApplication = new DefaultWebApplication();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

import java.io.IOException;

import jakarta.servlet.Servlet;
import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRegistration;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
Expand Down
2 changes: 2 additions & 0 deletions dist/platform/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@

exports cloud.piranha.dist.platform;
opens cloud.piranha.dist.platform;
requires transitive cloud.piranha.core.api;
requires cloud.piranha.core.impl;
requires cloud.piranha.extension.platform;
requires cloud.piranha.multi;
requires transitive jakarta.servlet;
}
1 change: 1 addition & 0 deletions dist/server/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

exports cloud.piranha.dist.server;
opens cloud.piranha.dist.server;
requires transitive cloud.piranha.core.api;
requires cloud.piranha.core.impl;
requires cloud.piranha.extension.servlet;
requires cloud.piranha.multi;
Expand Down

0 comments on commit 6975429

Please sign in to comment.