diff options
author | Jacek Poreda <jacek.poreda@sonarsource.com> | 2024-12-11 13:08:24 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-12-18 20:03:11 +0000 |
commit | 6a146e820674a08f14b03db7f48f3ec7d393d38b (patch) | |
tree | 18e1663e8c7399f31bbc99f627d5223adfe472b3 /server/sonar-webserver/src/main/java/org/sonar | |
parent | 086f2ce821d41363460d1b897b3631dc498524c5 (diff) | |
download | sonarqube-6a146e820674a08f14b03db7f48f3ec7d393d38b.tar.gz sonarqube-6a146e820674a08f14b03db7f48f3ec7d393d38b.zip |
SONAR-19122 Upgrade to Spring 6
Diffstat (limited to 'server/sonar-webserver/src/main/java/org/sonar')
17 files changed, 98 insertions, 98 deletions
diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/app/NullJarScanner.java b/server/sonar-webserver/src/main/java/org/sonar/server/app/NullJarScanner.java index 4b904088aa1..a3461ca4e56 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/app/NullJarScanner.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/app/NullJarScanner.java @@ -19,22 +19,22 @@ */ package org.sonar.server.app; +import jakarta.servlet.ServletContext; import org.apache.tomcat.JarScanFilter; import org.apache.tomcat.JarScanType; import org.apache.tomcat.JarScanner; import org.apache.tomcat.JarScannerCallback; -import javax.servlet.ServletContext; - /** * Disable taglib and web-fragment.xml scanning of Tomcat. Should speed up startup. */ class NullJarScanner implements JarScanner { + @Override public void scan(JarScanType jarScanType, ServletContext servletContext, JarScannerCallback jarScannerCallback) { - // doing nothing is fast! + } @Override diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/app/SecureErrorReportValve.java b/server/sonar-webserver/src/main/java/org/sonar/server/app/SecureErrorReportValve.java index 9c0807df7c5..a5c62762720 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/app/SecureErrorReportValve.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/app/SecureErrorReportValve.java @@ -20,7 +20,7 @@ package org.sonar.server.app; import java.io.IOException; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.catalina.valves.ErrorReportValve; diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/app/TomcatAccessLog.java b/server/sonar-webserver/src/main/java/org/sonar/server/app/TomcatAccessLog.java index 8690422eef0..04a40f5e35d 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/app/TomcatAccessLog.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/app/TomcatAccessLog.java @@ -19,7 +19,7 @@ */ package org.sonar.server.app; -import ch.qos.logback.access.PatternLayoutEncoder; +import ch.qos.logback.access.common.PatternLayoutEncoder; import ch.qos.logback.core.FileAppender; import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleListener; diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/PlatformImpl.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/PlatformImpl.java index 28821f02993..3c78d45c015 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/PlatformImpl.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/PlatformImpl.java @@ -24,8 +24,8 @@ import java.util.Collection; import java.util.List; import java.util.Properties; import javax.annotation.Nullable; -import javax.servlet.ServletContext; -import javax.servlet.ServletRegistration; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletRegistration; import org.sonar.api.utils.log.Logger; import org.sonar.api.utils.log.Loggers; import org.sonar.api.utils.log.Profiler; diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/ApiV2Servlet.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/ApiV2Servlet.java index 13bce63f780..40d3184f9cf 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/ApiV2Servlet.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/ApiV2Servlet.java @@ -23,12 +23,12 @@ import com.google.common.annotations.VisibleForTesting; import java.io.IOException; import java.util.concurrent.CountDownLatch; import java.util.function.Function; -import javax.servlet.Servlet; -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Servlet; +import jakarta.servlet.ServletConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletResponse; import org.sonar.server.platform.platformlevel.PlatformLevel; import org.sonar.server.v2.config.PlatformLevel4WebConfig; import org.sonar.server.v2.config.SafeModeWebConfig; diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/CacheControlFilter.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/CacheControlFilter.java index c4e45de539a..f5a78f717af 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/CacheControlFilter.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/CacheControlFilter.java @@ -22,14 +22,14 @@ package org.sonar.server.platform.web; import com.google.common.collect.ImmutableMap; import java.io.IOException; import java.util.Map; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import static java.lang.String.format; diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/CspFilter.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/CspFilter.java index 2a6372101d9..c1095228fbf 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/CspFilter.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/CspFilter.java @@ -26,13 +26,13 @@ import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Base64; import java.util.List; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletResponse; public class CspFilter implements Filter { diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/EndpointPathFilter.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/EndpointPathFilter.java index 10294339d34..73f1a2043d5 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/EndpointPathFilter.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/EndpointPathFilter.java @@ -20,13 +20,13 @@ package org.sonar.server.platform.web; import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; import org.sonar.server.platform.web.logging.EntrypointMDCStorage; public class EndpointPathFilter implements Filter { diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/MasterServletFilter.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/MasterServletFilter.java index 1e6fe58235d..d3c3159dcab 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/MasterServletFilter.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/MasterServletFilter.java @@ -28,21 +28,21 @@ import java.util.LinkedList; import java.util.List; import javax.annotation.CheckForNull; import javax.annotation.Nullable; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.sonar.api.server.http.HttpRequest; import org.sonar.api.server.http.HttpResponse; import org.slf4j.LoggerFactory; import org.sonar.api.web.HttpFilter; -import org.sonar.server.http.JavaxHttpRequest; -import org.sonar.server.http.JavaxHttpResponse; +import org.sonar.server.http.JakartaHttpRequest; +import org.sonar.server.http.JakartaHttpResponse; import org.sonar.server.platform.PlatformImpl; /** @@ -186,8 +186,8 @@ public class MasterServletFilter implements Filter { @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException { - HttpRequest javaxHttpRequest = new JavaxHttpRequest((HttpServletRequest) servletRequest); - HttpResponse javaxHttpResponse = new JavaxHttpResponse((HttpServletResponse) servletResponse); + HttpRequest javaxHttpRequest = new JakartaHttpRequest((HttpServletRequest) servletRequest); + HttpResponse javaxHttpResponse = new JakartaHttpResponse((HttpServletResponse) servletResponse); httpFilter.doFilter(javaxHttpRequest, javaxHttpResponse, new HttpFilterChainAdapter(chain)); } } @@ -202,7 +202,7 @@ public class MasterServletFilter implements Filter { @Override public void doFilter(HttpRequest httpRequest, HttpResponse httpResponse) throws IOException { try { - filterChain.doFilter(((JavaxHttpRequest) httpRequest).getDelegate(), ((JavaxHttpResponse) httpResponse).getDelegate()); + filterChain.doFilter(((JakartaHttpRequest) httpRequest).getDelegate(), ((JakartaHttpResponse) httpResponse).getDelegate()); } catch (ServletException e) { throw new RuntimeException(e); } diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/PlatformServletContextListener.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/PlatformServletContextListener.java index 41562c6d656..6b6c6967341 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/PlatformServletContextListener.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/PlatformServletContextListener.java @@ -21,9 +21,9 @@ package org.sonar.server.platform.web; import java.util.Enumeration; import java.util.Properties; -import javax.servlet.ServletContext; -import javax.servlet.ServletContextEvent; -import javax.servlet.ServletContextListener; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletContextEvent; +import jakarta.servlet.ServletContextListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.server.platform.PlatformImpl; diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/RedirectFilter.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/RedirectFilter.java index b79af5c6935..043e51cd965 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/RedirectFilter.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/RedirectFilter.java @@ -23,14 +23,14 @@ import java.io.IOException; import java.util.List; import java.util.function.Function; import java.util.function.Predicate; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import static java.lang.String.format; diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/RequestIdFilter.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/RequestIdFilter.java index 8346836e476..fe120621787 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/RequestIdFilter.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/RequestIdFilter.java @@ -21,12 +21,12 @@ package org.sonar.server.platform.web; import com.google.common.annotations.VisibleForTesting; import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; import org.sonar.server.platform.Platform; import org.sonar.server.platform.PlatformImpl; import org.sonar.server.platform.web.requestid.RequestIdGenerator; diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/SecurityServletFilter.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/SecurityServletFilter.java index ce0687a7011..3a5f3a16394 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/SecurityServletFilter.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/SecurityServletFilter.java @@ -21,14 +21,14 @@ package org.sonar.server.platform.web; import java.io.IOException; import java.util.Set; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; /** * This servlet filter sets response headers that enable browser protection against several classes if Web attacks. diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/StaticResourcesServlet.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/StaticResourcesServlet.java index dcb6755bcc5..4269c064efa 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/StaticResourcesServlet.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/StaticResourcesServlet.java @@ -24,9 +24,9 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import javax.annotation.CheckForNull; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.apache.catalina.connector.ClientAbortException; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; @@ -38,8 +38,8 @@ import org.sonar.server.platform.PlatformImpl; import org.sonarqube.ws.MediaTypes; import static java.lang.String.format; -import static javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR; -import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND; +import static jakarta.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR; +import static jakarta.servlet.http.HttpServletResponse.SC_NOT_FOUND; public class StaticResourcesServlet extends HttpServlet { diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/UserSessionFilter.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/UserSessionFilter.java index cfba1572027..2d2f6c8913b 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/UserSessionFilter.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/UserSessionFilter.java @@ -22,20 +22,20 @@ package org.sonar.server.platform.web; import com.google.common.annotations.VisibleForTesting; import java.io.IOException; import javax.annotation.Nullable; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.db.DBSessions; import org.sonar.server.authentication.UserSessionInitializer; -import org.sonar.server.http.JavaxHttpRequest; -import org.sonar.server.http.JavaxHttpResponse; +import org.sonar.server.http.JakartaHttpRequest; +import org.sonar.server.http.JakartaHttpResponse; import org.sonar.server.platform.Platform; import org.sonar.server.platform.PlatformImpl; import org.sonar.server.setting.ThreadLocalSettings; @@ -79,7 +79,7 @@ public class UserSessionFilter implements Filter { private static void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain, @Nullable UserSessionInitializer userSessionInitializer) throws IOException, ServletException { try { - if (userSessionInitializer == null || userSessionInitializer.initUserSession(new JavaxHttpRequest(request), new JavaxHttpResponse(response))) { + if (userSessionInitializer == null || userSessionInitializer.initUserSession(new JakartaHttpRequest(request), new JakartaHttpResponse(response))) { chain.doFilter(request, response); } } finally { diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesCache.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesCache.java index 7bd6929d18e..4018b11e4d4 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesCache.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesCache.java @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; import java.util.Set; -import javax.servlet.ServletContext; +import jakarta.servlet.ServletContext; import org.apache.commons.io.IOUtils; import org.sonar.server.platform.OfficialDistribution; import org.sonar.server.platform.Platform; diff --git a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesFilter.java b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesFilter.java index 7738429dd79..26d7cea175b 100644 --- a/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesFilter.java +++ b/server/sonar-webserver/src/main/java/org/sonar/server/platform/web/WebPagesFilter.java @@ -21,14 +21,14 @@ package org.sonar.server.platform.web; import com.google.common.annotations.VisibleForTesting; import java.io.IOException; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.FilterConfig; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.sonar.api.web.UrlPattern; import org.sonar.server.platform.PlatformImpl; |