diff --git a/spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java b/spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java index 6f284df3ad5..adc8502814f 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java @@ -149,8 +149,6 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean private static final boolean jndiPresent = ClassUtils.isPresent( "javax.naming.InitialContext", CommonAnnotationBeanPostProcessor.class.getClassLoader()); - private static final Set> resourceAnnotationTypes = CollectionUtils.newLinkedHashSet(3); - @Nullable private static final Class jakartaResourceType; @@ -160,6 +158,8 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean @Nullable private static final Class ejbAnnotationType; + private static final Set> resourceAnnotationTypes = CollectionUtils.newLinkedHashSet(3); + static { jakartaResourceType = loadAnnotationType("jakarta.annotation.Resource"); if (jakartaResourceType != null) { diff --git a/spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java b/spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java index 630eca9c5a8..fb444c80a61 100644 --- a/spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java +++ b/spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java @@ -63,9 +63,9 @@ import org.springframework.web.util.WebUtils; * *

As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline. * - *

Compatible with Servlet 3.1 but can be configured to expose a specific version - * through {@link #setMajorVersion}/{@link #setMinorVersion}; default is 3.1. - * Note that Servlet 3.1 support is limited: servlet, filter and listener + *

Compatible with Servlet 6.0 but can be configured to expose a specific version + * through {@link #setMajorVersion}/{@link #setMinorVersion}; default is 6.0. + * Note that some Servlet SPI support is limited: servlet, filter and listener * registration methods are not supported; neither is JSP configuration. * We generally do not recommend to unit test your ServletContainerInitializers and * WebApplicationInitializers which is where those registration methods would be used. diff --git a/spring-test/src/test/java/org/springframework/mock/web/MockServletContextTests.java b/spring-test/src/test/java/org/springframework/mock/web/MockServletContextTests.java index b5ddcf4507c..258d5103bed 100644 --- a/spring-test/src/test/java/org/springframework/mock/web/MockServletContextTests.java +++ b/spring-test/src/test/java/org/springframework/mock/web/MockServletContextTests.java @@ -200,9 +200,9 @@ class MockServletContextTests { assertThat(filterRegistrations).isNotNull(); assertThat(filterRegistrations).isEmpty(); } - } + /** * @since 5.1.11 */ @@ -242,7 +242,6 @@ class MockServletContextTests { assertThat(realPath).isNotNull(); } } - } } diff --git a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockServletContext.java b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockServletContext.java index fdf4e122568..58019b7ec18 100644 --- a/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockServletContext.java +++ b/spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockServletContext.java @@ -63,9 +63,9 @@ import org.springframework.web.util.WebUtils; * *

As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline. * - *

Compatible with Servlet 3.1 but can be configured to expose a specific version - * through {@link #setMajorVersion}/{@link #setMinorVersion}; default is 3.1. - * Note that Servlet 3.1 support is limited: servlet, filter and listener + *

Compatible with Servlet 6.0 but can be configured to expose a specific version + * through {@link #setMajorVersion}/{@link #setMinorVersion}; default is 6.0. + * Note that some Servlet SPI support is limited: servlet, filter and listener * registration methods are not supported; neither is JSP configuration. * We generally do not recommend to unit test your ServletContainerInitializers and * WebApplicationInitializers which is where those registration methods would be used. diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultServerRequest.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultServerRequest.java index 808bec35b95..871b945ce47 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultServerRequest.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultServerRequest.java @@ -653,7 +653,6 @@ class DefaultServerRequest implements ServerRequest { return this.headers.keySet(); } - // Unsupported @Override @@ -706,7 +705,6 @@ class DefaultServerRequest implements ServerRequest { throw new UnsupportedOperationException(); } - @Override public String getCharacterEncoding() { throw new UnsupportedOperationException();