Browse Source

Polishing

pull/35687/head
Juergen Hoeller 2 months ago
parent
commit
7adcd99ea2
  1. 4
      spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java
  2. 6
      spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java
  3. 3
      spring-test/src/test/java/org/springframework/mock/web/MockServletContextTests.java
  4. 6
      spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockServletContext.java
  5. 2
      spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultServerRequest.java

4
spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java

@ -149,8 +149,6 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean @@ -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<Class<? extends Annotation>> resourceAnnotationTypes = CollectionUtils.newLinkedHashSet(3);
@Nullable
private static final Class<? extends Annotation> jakartaResourceType;
@ -160,6 +158,8 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean @@ -160,6 +158,8 @@ public class CommonAnnotationBeanPostProcessor extends InitDestroyAnnotationBean
@Nullable
private static final Class<? extends Annotation> ejbAnnotationType;
private static final Set<Class<? extends Annotation>> resourceAnnotationTypes = CollectionUtils.newLinkedHashSet(3);
static {
jakartaResourceType = loadAnnotationType("jakarta.annotation.Resource");
if (jakartaResourceType != null) {

6
spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java

@ -63,9 +63,9 @@ import org.springframework.web.util.WebUtils; @@ -63,9 +63,9 @@ import org.springframework.web.util.WebUtils;
*
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
*
* <p>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
* <p>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.

3
spring-test/src/test/java/org/springframework/mock/web/MockServletContextTests.java

@ -200,9 +200,9 @@ class MockServletContextTests { @@ -200,9 +200,9 @@ class MockServletContextTests {
assertThat(filterRegistrations).isNotNull();
assertThat(filterRegistrations).isEmpty();
}
}
/**
* @since 5.1.11
*/
@ -242,7 +242,6 @@ class MockServletContextTests { @@ -242,7 +242,6 @@ class MockServletContextTests {
assertThat(realPath).isNotNull();
}
}
}
}

6
spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockServletContext.java

@ -63,9 +63,9 @@ import org.springframework.web.util.WebUtils; @@ -63,9 +63,9 @@ import org.springframework.web.util.WebUtils;
*
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
*
* <p>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
* <p>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.

2
spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultServerRequest.java

@ -653,7 +653,6 @@ class DefaultServerRequest implements ServerRequest { @@ -653,7 +653,6 @@ class DefaultServerRequest implements ServerRequest {
return this.headers.keySet();
}
// Unsupported
@Override
@ -706,7 +705,6 @@ class DefaultServerRequest implements ServerRequest { @@ -706,7 +705,6 @@ class DefaultServerRequest implements ServerRequest {
throw new UnsupportedOperationException();
}
@Override
public String getCharacterEncoding() {
throw new UnsupportedOperationException();

Loading…
Cancel
Save