diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java index 79c1fe20ca..746fd1d3d4 100644 --- a/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java +++ b/spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java @@ -510,7 +510,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport List allInterceptors = new ArrayList<>(); if (specificInterceptors != null) { if (specificInterceptors.length > 0) { - // specificInterceptors may equals PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS + // specificInterceptors may equal PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS allInterceptors.addAll(Arrays.asList(specificInterceptors)); } if (commonInterceptors.length > 0) { diff --git a/spring-context/src/main/java/org/springframework/validation/annotation/ValidationAnnotationUtils.java b/spring-context/src/main/java/org/springframework/validation/annotation/ValidationAnnotationUtils.java index 05a265247b..196f6fc6c7 100644 --- a/spring-context/src/main/java/org/springframework/validation/annotation/ValidationAnnotationUtils.java +++ b/spring-context/src/main/java/org/springframework/validation/annotation/ValidationAnnotationUtils.java @@ -30,6 +30,8 @@ import org.springframework.lang.Nullable; */ public abstract class ValidationAnnotationUtils { + private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0]; + /** * Determine any validation hints by the given annotation. *

This implementation checks for {@code @javax.validation.Valid}, @@ -38,14 +40,13 @@ public abstract class ValidationAnnotationUtils { * @param ann the annotation (potentially a validation annotation) * @return the validation hints to apply (possibly an empty array), * or {@code null} if this annotation does not trigger any validation - * @since 5.3.7 */ @Nullable public static Object[] determineValidationHints(Annotation ann) { Class annotationType = ann.annotationType(); String annotationName = annotationType.getName(); if ("javax.validation.Valid".equals(annotationName)) { - return new Object[0]; + return EMPTY_OBJECT_ARRAY; } Validated validatedAnn = AnnotationUtils.getAnnotation(ann, Validated.class); if (validatedAnn != null) { @@ -61,7 +62,7 @@ public abstract class ValidationAnnotationUtils { private static Object[] convertValidationHints(@Nullable Object hints) { if (hints == null) { - return new Object[0]; + return EMPTY_OBJECT_ARRAY; } return (hints instanceof Object[] ? (Object[]) hints : new Object[]{hints}); } diff --git a/spring-context/src/test/java/org/springframework/format/datetime/DateFormattingTests.java b/spring-context/src/test/java/org/springframework/format/datetime/DateFormattingTests.java index df7729181f..77db53f069 100644 --- a/spring-context/src/test/java/org/springframework/format/datetime/DateFormattingTests.java +++ b/spring-context/src/test/java/org/springframework/format/datetime/DateFormattingTests.java @@ -130,7 +130,6 @@ public class DateFormattingTests { assertThat(bindingResult.getErrorCount()).isEqualTo(1); FieldError fieldError = bindingResult.getFieldError(propertyName); TypeMismatchException exception = fieldError.unwrap(TypeMismatchException.class); - exception.printStackTrace(System.err); assertThat(exception) .hasMessageContaining("for property 'styleDate'") .hasCauseInstanceOf(ConversionFailedException.class).getCause() diff --git a/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java b/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java index 02e90ba16f..1b45d2d36c 100644 --- a/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java +++ b/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java @@ -496,7 +496,6 @@ class MockHttpServletResponseTests { String expiryDate = "Tue, 8 Oct 2019 19:50:00 GMT"; String cookieValue = "SESSION=123; Path=/; Expires=" + expiryDate; response.addHeader(SET_COOKIE, cookieValue); - System.err.println(response.getCookie("SESSION")); assertThat(response.getHeader(SET_COOKIE)).isEqualTo(cookieValue); assertNumCookies(1); diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFunction.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFunction.java index bb69193e5e..6d35b6594c 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFunction.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFunction.java @@ -44,7 +44,7 @@ public interface ExchangeFunction { /** * Exchange the given request for a {@link ClientResponse} promise. * - *

Note: When a calling this method from an + *

Note: When calling this method from an * {@link ExchangeFilterFunction} that handles the response in some way, * extra care must be taken to always consume its content or otherwise * propagate it downstream for further handling, for example by the diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java index c8cddf01e4..6d3e8d3d2b 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java @@ -1085,7 +1085,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic } DispatcherType dispatchType = request.getDispatcherType(); - boolean initialDispatch = DispatcherType.REQUEST.equals(request.getDispatcherType()); + boolean initialDispatch = DispatcherType.REQUEST == dispatchType; if (failureCause != null) { if (!initialDispatch) {