Skip to content

Commit f3f1950

Browse files
committed
Polishing
1 parent 72b2dda commit f3f1950

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

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

Lines changed: 1 addition & 2 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-2020 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.
@@ -38,7 +38,6 @@ public class HandlerMethodReturnValueHandlerComposite implements HandlerMethodRe
3838

3939
protected final Log logger = LogFactory.getLog(getClass());
4040

41-
4241
private final List<HandlerMethodReturnValueHandler> returnValueHandlers = new ArrayList<>();
4342

4443

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -46,7 +46,7 @@
4646
*/
4747
class InvocableHelper {
4848

49-
private static Log logger = LogFactory.getLog(InvocableHelper.class);
49+
private static final Log logger = LogFactory.getLog(InvocableHelper.class);
5050

5151

5252
private final HandlerMethodArgumentResolverComposite argumentResolvers =

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -46,13 +46,13 @@ public class InvocableHandlerMethod extends HandlerMethod {
4646
private static final Object[] EMPTY_ARGS = new Object[0];
4747

4848

49-
@Nullable
50-
private WebDataBinderFactory dataBinderFactory;
51-
5249
private HandlerMethodArgumentResolverComposite resolvers = new HandlerMethodArgumentResolverComposite();
5350

5451
private ParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer();
5552

53+
@Nullable
54+
private WebDataBinderFactory dataBinderFactory;
55+
5656

5757
/**
5858
* Create an instance from a {@code HandlerMethod}.
@@ -83,16 +83,8 @@ public InvocableHandlerMethod(Object bean, String methodName, Class<?>... parame
8383

8484

8585
/**
86-
* Set the {@link WebDataBinderFactory} to be passed to argument resolvers allowing them to create
87-
* a {@link WebDataBinder} for data binding and type conversion purposes.
88-
* @param dataBinderFactory the data binder factory.
89-
*/
90-
public void setDataBinderFactory(WebDataBinderFactory dataBinderFactory) {
91-
this.dataBinderFactory = dataBinderFactory;
92-
}
93-
94-
/**
95-
* Set {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers} to use to use for resolving method argument values.
86+
* Set {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers}
87+
* to use for resolving method argument values.
9688
*/
9789
public void setHandlerMethodArgumentResolvers(HandlerMethodArgumentResolverComposite argumentResolvers) {
9890
this.resolvers = argumentResolvers;
@@ -107,6 +99,14 @@ public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDisc
10799
this.parameterNameDiscoverer = parameterNameDiscoverer;
108100
}
109101

102+
/**
103+
* Set the {@link WebDataBinderFactory} to be passed to argument resolvers allowing them
104+
* to create a {@link WebDataBinder} for data binding and type conversion purposes.
105+
*/
106+
public void setDataBinderFactory(WebDataBinderFactory dataBinderFactory) {
107+
this.dataBinderFactory = dataBinderFactory;
108+
}
109+
110110

111111
/**
112112
* Invoke the method after resolving its argument values in the context of the given request.

spring-webflux/src/main/java/org/springframework/web/reactive/result/method/InvocableHandlerMethod.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -60,7 +60,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
6060
private static final Object NO_ARG_VALUE = new Object();
6161

6262

63-
private HandlerMethodArgumentResolverComposite resolvers = new HandlerMethodArgumentResolverComposite();
63+
private final HandlerMethodArgumentResolverComposite resolvers = new HandlerMethodArgumentResolverComposite();
6464

6565
private ParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer();
6666

@@ -139,8 +139,9 @@ public Mono<HandlerResult> invoke(
139139
try {
140140
ReflectionUtils.makeAccessible(getBridgedMethod());
141141
Method method = getBridgedMethod();
142-
if (KotlinDetector.isKotlinReflectPresent() && KotlinDetector.isKotlinType(method.getDeclaringClass())
143-
&& CoroutinesUtils.isSuspendingFunction(method)) {
142+
if (KotlinDetector.isKotlinReflectPresent() &&
143+
KotlinDetector.isKotlinType(method.getDeclaringClass()) &&
144+
CoroutinesUtils.isSuspendingFunction(method)) {
144145
value = CoroutinesUtils.invokeSuspendingFunction(method, getBean(), args);
145146
}
146147
else {

0 commit comments

Comments
 (0)