Skip to content

Commit 5b91297

Browse files
committed
Polishing
1 parent c14d2d3 commit 5b91297

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/config/DependencyDescriptor.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -84,8 +84,9 @@ public DependencyDescriptor(MethodParameter methodParameter, boolean required) {
8484
*/
8585
public DependencyDescriptor(MethodParameter methodParameter, boolean required, boolean eager) {
8686
super(methodParameter);
87+
8788
this.declaringClass = methodParameter.getDeclaringClass();
88-
if (this.methodParameter.getMethod() != null) {
89+
if (methodParameter.getMethod() != null) {
8990
this.methodName = methodParameter.getMethod().getName();
9091
this.parameterTypes = methodParameter.getMethod().getParameterTypes();
9192
}
@@ -117,6 +118,7 @@ public DependencyDescriptor(Field field, boolean required) {
117118
*/
118119
public DependencyDescriptor(Field field, boolean required, boolean eager) {
119120
super(field);
121+
120122
this.declaringClass = field.getDeclaringClass();
121123
this.fieldName = field.getName();
122124
this.required = required;
@@ -129,6 +131,7 @@ public DependencyDescriptor(Field field, boolean required, boolean eager) {
129131
*/
130132
public DependencyDescriptor(DependencyDescriptor original) {
131133
super(original);
134+
132135
this.declaringClass = original.declaringClass;
133136
this.methodName = original.methodName;
134137
this.parameterTypes = original.parameterTypes;
@@ -236,7 +239,7 @@ public void setContainingClass(Class<?> containingClass) {
236239
}
237240

238241
/**
239-
* Build a ResolvableType object for the wrapped parameter/field.
242+
* Build a {@link ResolvableType} object for the wrapped parameter/field.
240243
* @since 4.0
241244
*/
242245
public ResolvableType getResolvableType() {

spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/HandlerMethodArgumentResolverComposite.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public class HandlerMethodArgumentResolverComposite implements HandlerMethodArgu
4545
/**
4646
* Add the given {@link HandlerMethodArgumentResolver}.
4747
*/
48-
public HandlerMethodArgumentResolverComposite addResolver(HandlerMethodArgumentResolver argumentResolver) {
49-
this.argumentResolvers.add(argumentResolver);
48+
public HandlerMethodArgumentResolverComposite addResolver(HandlerMethodArgumentResolver resolver) {
49+
this.argumentResolvers.add(resolver);
5050
return this;
5151
}
5252

@@ -99,8 +99,7 @@ public boolean supportsParameter(MethodParameter parameter) {
9999
* Iterate over registered
100100
* {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers}
101101
* and invoke the one that supports it.
102-
* @throws IllegalStateException if no suitable
103-
* {@link HandlerMethodArgumentResolver} is found.
102+
* @throws IllegalArgumentException if no suitable argument resolver is found
104103
*/
105104
@Override
106105
public Object resolveArgument(MethodParameter parameter, Message<?> message) throws Exception {

spring-web/src/main/java/org/springframework/http/HttpStatus.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -431,6 +431,7 @@ public Series series() {
431431
* Whether this status code is in the HTTP series
432432
* {@link org.springframework.http.HttpStatus.Series#INFORMATIONAL}.
433433
* This is a shortcut for checking the value of {@link #series()}.
434+
* @since 4.0
434435
* @see #series()
435436
*/
436437
public boolean is1xxInformational() {
@@ -441,6 +442,7 @@ public boolean is1xxInformational() {
441442
* Whether this status code is in the HTTP series
442443
* {@link org.springframework.http.HttpStatus.Series#SUCCESSFUL}.
443444
* This is a shortcut for checking the value of {@link #series()}.
445+
* @since 4.0
444446
* @see #series()
445447
*/
446448
public boolean is2xxSuccessful() {
@@ -451,6 +453,7 @@ public boolean is2xxSuccessful() {
451453
* Whether this status code is in the HTTP series
452454
* {@link org.springframework.http.HttpStatus.Series#REDIRECTION}.
453455
* This is a shortcut for checking the value of {@link #series()}.
456+
* @since 4.0
454457
* @see #series()
455458
*/
456459
public boolean is3xxRedirection() {
@@ -461,6 +464,7 @@ public boolean is3xxRedirection() {
461464
* Whether this status code is in the HTTP series
462465
* {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR}.
463466
* This is a shortcut for checking the value of {@link #series()}.
467+
* @since 4.0
464468
* @see #series()
465469
*/
466470
public boolean is4xxClientError() {
@@ -471,6 +475,7 @@ public boolean is4xxClientError() {
471475
* Whether this status code is in the HTTP series
472476
* {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR}.
473477
* This is a shortcut for checking the value of {@link #series()}.
478+
* @since 4.0
474479
* @see #series()
475480
*/
476481
public boolean is5xxServerError() {

spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolverComposite.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,9 @@ public boolean supportsParameter(MethodParameter parameter) {
106106

107107
/**
108108
* Iterate over registered
109-
* {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers} and
110-
* invoke the one that supports it.
111-
* @throws IllegalStateException if no suitable
112-
* {@link HandlerMethodArgumentResolver} is found.
109+
* {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers}
110+
* and invoke the one that supports it.
111+
* @throws IllegalArgumentException if no suitable argument resolver is found
113112
*/
114113
@Override
115114
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
@@ -130,9 +129,9 @@ public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer m
130129
private HandlerMethodArgumentResolver getArgumentResolver(MethodParameter parameter) {
131130
HandlerMethodArgumentResolver result = this.argumentResolverCache.get(parameter);
132131
if (result == null) {
133-
for (HandlerMethodArgumentResolver methodArgumentResolver : this.argumentResolvers) {
134-
if (methodArgumentResolver.supportsParameter(parameter)) {
135-
result = methodArgumentResolver;
132+
for (HandlerMethodArgumentResolver resolver : this.argumentResolvers) {
133+
if (resolver.supportsParameter(parameter)) {
134+
result = resolver;
136135
this.argumentResolverCache.put(parameter, result);
137136
break;
138137
}

0 commit comments

Comments
 (0)