Skip to content

Commit 98770b1

Browse files
authored
Polishing
Closes gh-26878
1 parent 697108c commit 98770b1

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ protected Advisor[] buildAdvisors(@Nullable String beanName, @Nullable Object[]
510510
List<Object> allInterceptors = new ArrayList<>();
511511
if (specificInterceptors != null) {
512512
if (specificInterceptors.length > 0) {
513-
// specificInterceptors may equals PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
513+
// specificInterceptors may equal PROXY_WITHOUT_ADDITIONAL_INTERCEPTORS
514514
allInterceptors.addAll(Arrays.asList(specificInterceptors));
515515
}
516516
if (commonInterceptors.length > 0) {

spring-context/src/main/java/org/springframework/validation/annotation/ValidationAnnotationUtils.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
*/
3131
public abstract class ValidationAnnotationUtils {
3232

33+
private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
34+
3335
/**
3436
* Determine any validation hints by the given annotation.
3537
* <p>This implementation checks for {@code @javax.validation.Valid},
@@ -38,14 +40,13 @@ public abstract class ValidationAnnotationUtils {
3840
* @param ann the annotation (potentially a validation annotation)
3941
* @return the validation hints to apply (possibly an empty array),
4042
* or {@code null} if this annotation does not trigger any validation
41-
* @since 5.3.7
4243
*/
4344
@Nullable
4445
public static Object[] determineValidationHints(Annotation ann) {
4546
Class<? extends Annotation> annotationType = ann.annotationType();
4647
String annotationName = annotationType.getName();
4748
if ("javax.validation.Valid".equals(annotationName)) {
48-
return new Object[0];
49+
return EMPTY_OBJECT_ARRAY;
4950
}
5051
Validated validatedAnn = AnnotationUtils.getAnnotation(ann, Validated.class);
5152
if (validatedAnn != null) {
@@ -61,7 +62,7 @@ public static Object[] determineValidationHints(Annotation ann) {
6162

6263
private static Object[] convertValidationHints(@Nullable Object hints) {
6364
if (hints == null) {
64-
return new Object[0];
65+
return EMPTY_OBJECT_ARRAY;
6566
}
6667
return (hints instanceof Object[] ? (Object[]) hints : new Object[]{hints});
6768
}

spring-context/src/test/java/org/springframework/format/datetime/DateFormattingTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ void styleDateWithInvalidFormat() {
130130
assertThat(bindingResult.getErrorCount()).isEqualTo(1);
131131
FieldError fieldError = bindingResult.getFieldError(propertyName);
132132
TypeMismatchException exception = fieldError.unwrap(TypeMismatchException.class);
133-
exception.printStackTrace(System.err);
134133
assertThat(exception)
135134
.hasMessageContaining("for property 'styleDate'")
136135
.hasCauseInstanceOf(ConversionFailedException.class).getCause()

spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,6 @@ void addCookieHeaderWithExpiresAttributeWithoutMaxAgeAttribute() {
496496
String expiryDate = "Tue, 8 Oct 2019 19:50:00 GMT";
497497
String cookieValue = "SESSION=123; Path=/; Expires=" + expiryDate;
498498
response.addHeader(SET_COOKIE, cookieValue);
499-
System.err.println(response.getCookie("SESSION"));
500499
assertThat(response.getHeader(SET_COOKIE)).isEqualTo(cookieValue);
501500

502501
assertNumCookies(1);

spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ExchangeFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public interface ExchangeFunction {
4444
/**
4545
* Exchange the given request for a {@link ClientResponse} promise.
4646
*
47-
* <p><strong>Note:</strong> When a calling this method from an
47+
* <p><strong>Note:</strong> When calling this method from an
4848
* {@link ExchangeFilterFunction} that handles the response in some way,
4949
* extra care must be taken to always consume its content or otherwise
5050
* propagate it downstream for further handling, for example by the

spring-webmvc/src/main/java/org/springframework/web/servlet/FrameworkServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ private void logResult(HttpServletRequest request, HttpServletResponse response,
10851085
}
10861086

10871087
DispatcherType dispatchType = request.getDispatcherType();
1088-
boolean initialDispatch = DispatcherType.REQUEST.equals(request.getDispatcherType());
1088+
boolean initialDispatch = DispatcherType.REQUEST == dispatchType;
10891089

10901090
if (failureCause != null) {
10911091
if (!initialDispatch) {

0 commit comments

Comments
 (0)