diff --git a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultHttpSessionManager.java b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultHttpSessionManager.java index 29d308b231..d3f43adb8b 100644 --- a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultHttpSessionManager.java +++ b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultHttpSessionManager.java @@ -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); diff --git a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultPushBuilder.java b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultPushBuilder.java index 76f85459e8..65dc961579 100644 --- a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultPushBuilder.java +++ b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultPushBuilder.java @@ -37,6 +37,7 @@ * * @author Manfred Riem (mriem@manorrock.com) */ +@SuppressWarnings("deprecation") public class DefaultPushBuilder implements PushBuilder { /** diff --git a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultServletRequestDispatcher.java b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultServletRequestDispatcher.java index c8dcb23ddd..19cda1923d 100644 --- a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultServletRequestDispatcher.java +++ b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultServletRequestDispatcher.java @@ -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. * diff --git a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultWebApplicationOutputStream.java b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultWebApplicationOutputStream.java index 20669868b6..abba8fa426 100644 --- a/core/impl/src/main/java/cloud/piranha/core/impl/DefaultWebApplicationOutputStream.java +++ b/core/impl/src/main/java/cloud/piranha/core/impl/DefaultWebApplicationOutputStream.java @@ -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()); diff --git a/core/impl/src/test/java/cloud/piranha/core/impl/CookieParserTest.java b/core/impl/src/test/java/cloud/piranha/core/impl/CookieParserTest.java index 97354357c0..9e305095f7 100644 --- a/core/impl/src/test/java/cloud/piranha/core/impl/CookieParserTest.java +++ b/core/impl/src/test/java/cloud/piranha/core/impl/CookieParserTest.java @@ -75,7 +75,7 @@ void parseMultipleCookies() { */ @Nested - @SuppressWarnings({"deprecation", "removal"}) + @SuppressWarnings({"removal"}) class Netscape { @Test void parseSingleCookie() { diff --git a/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebApplicationRequestTest.java b/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebApplicationRequestTest.java index dfe04b9198..eedc623d62 100644 --- a/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebApplicationRequestTest.java +++ b/core/impl/src/test/java/cloud/piranha/core/impl/DefaultWebApplicationRequestTest.java @@ -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; @@ -855,6 +852,7 @@ void testLogout() { /** * Test newPushBuilder method. */ + @SuppressWarnings("deprecation") @Test void testNewPushBuilder() { DefaultWebApplicationRequest request = new DefaultWebApplicationRequest(); diff --git a/core/impl/src/test/java/cloud/piranha/core/impl/HttpSessionTest.java b/core/impl/src/test/java/cloud/piranha/core/impl/HttpSessionTest.java index 9acc63b1fe..3e0c0d99d1 100644 --- a/core/impl/src/test/java/cloud/piranha/core/impl/HttpSessionTest.java +++ b/core/impl/src/test/java/cloud/piranha/core/impl/HttpSessionTest.java @@ -412,7 +412,7 @@ void testGetAttributeNames() { /** * Test getCookies method. */ - @SuppressWarnings({"deprecation", "removal"}) + @SuppressWarnings({"removal"}) @Test void testGetCookies() { DefaultWebApplication webApplication = new DefaultWebApplication(); @@ -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"); @@ -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 { @@ -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(); @@ -836,7 +836,7 @@ void testSetComment() throws Exception { /** * Test setComment. */ - @SuppressWarnings({"deprecation", "removal"}) + @SuppressWarnings({"removal"}) @Test void testSetComment2() throws Exception { DefaultWebApplication webApplication = new DefaultWebApplication(); diff --git a/core/impl/src/test/java/cloud/piranha/core/impl/ServletTest.java b/core/impl/src/test/java/cloud/piranha/core/impl/ServletTest.java index 05721c2cd2..bc2ad7d9ed 100644 --- a/core/impl/src/test/java/cloud/piranha/core/impl/ServletTest.java +++ b/core/impl/src/test/java/cloud/piranha/core/impl/ServletTest.java @@ -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; diff --git a/dist/platform/src/main/java/module-info.java b/dist/platform/src/main/java/module-info.java index 4170d4c18c..39affe6da4 100644 --- a/dist/platform/src/main/java/module-info.java +++ b/dist/platform/src/main/java/module-info.java @@ -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; } diff --git a/dist/server/src/main/java/module-info.java b/dist/server/src/main/java/module-info.java index 51b25dd020..d4a7c14405 100644 --- a/dist/server/src/main/java/module-info.java +++ b/dist/server/src/main/java/module-info.java @@ -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;