@@ -88,6 +88,7 @@ private void initResponseStatus() {
88
88
}
89
89
}
90
90
91
+
91
92
/**
92
93
* Register {@link HandlerMethodReturnValueHandler} instances to use to
93
94
* handle return values.
@@ -99,16 +100,14 @@ public void setHandlerMethodReturnValueHandlers(HandlerMethodReturnValueHandlerC
99
100
/**
100
101
* Invokes the method and handles the return value through one of the
101
102
* configured {@link HandlerMethodReturnValueHandler}s.
102
- *
103
103
* @param webRequest the current request
104
104
* @param mavContainer the ModelAndViewContainer for this request
105
- * @param providedArgs "given" arguments matched by type, not resolved
105
+ * @param providedArgs "given" arguments matched by type ( not resolved)
106
106
*/
107
- public final void invokeAndHandle (ServletWebRequest webRequest ,
107
+ public void invokeAndHandle (ServletWebRequest webRequest ,
108
108
ModelAndViewContainer mavContainer , Object ... providedArgs ) throws Exception {
109
109
110
110
Object returnValue = invokeForRequest (webRequest , mavContainer , providedArgs );
111
-
112
111
setResponseStatus (webRequest );
113
112
114
113
if (returnValue == null ) {
@@ -123,9 +122,9 @@ else if (StringUtils.hasText(this.responseReason)) {
123
122
}
124
123
125
124
mavContainer .setRequestHandled (false );
126
-
127
125
try {
128
- this .returnValueHandlers .handleReturnValue (returnValue , getReturnValueType (returnValue ), mavContainer , webRequest );
126
+ this .returnValueHandlers .handleReturnValue (
127
+ returnValue , getReturnValueType (returnValue ), mavContainer , webRequest );
129
128
}
130
129
catch (Exception ex ) {
131
130
if (logger .isTraceEnabled ()) {
@@ -165,20 +164,20 @@ private boolean isRequestNotModified(ServletWebRequest webRequest) {
165
164
* Does this method have the response status instruction?
166
165
*/
167
166
private boolean hasResponseStatus () {
168
- return this .responseStatus != null ;
167
+ return ( this .responseStatus != null ) ;
169
168
}
170
169
171
170
private String getReturnValueHandlingErrorMessage (String message , Object returnValue ) {
172
171
StringBuilder sb = new StringBuilder (message );
173
172
if (returnValue != null ) {
174
- sb .append (" [type=" + returnValue .getClass ().getName () + "] " );
173
+ sb .append (" [type=" ). append ( returnValue .getClass ().getName ()). append ( "] " );
175
174
}
176
- sb .append ("[value=" + returnValue + "]" );
175
+ sb .append (" [value=" ). append ( returnValue ). append ( "]" );
177
176
return getDetailedErrorMessage (sb .toString ());
178
177
}
179
178
180
179
/**
181
- * Create a nested ServletInvocableHandlerMethod sub-class that returns the
180
+ * Create a nested ServletInvocableHandlerMethod subclass that returns the
182
181
* the given value (or raises an Exception if the value is one) rather than
183
182
* actually invoking the controller method. This is useful when processing
184
183
* async return values (e.g. Callable, DeferredResult, ListenableFuture).
@@ -189,7 +188,7 @@ ServletInvocableHandlerMethod wrapConcurrentResult(Object result) {
189
188
190
189
191
190
/**
192
- * A nested sub-class of {@code ServletInvocableHandlerMethod} that uses a
191
+ * A nested subclass of {@code ServletInvocableHandlerMethod} that uses a
193
192
* simple {@link Callable} instead of the original controller as the handler in
194
193
* order to return the fixed (concurrent) result value given to it. Effectively
195
194
* "resumes" processing with the asynchronously produced return value.
@@ -198,7 +197,6 @@ private class ConcurrentResultHandlerMethod extends ServletInvocableHandlerMetho
198
197
199
198
private final MethodParameter returnType ;
200
199
201
-
202
200
public ConcurrentResultHandlerMethod (final Object result , ConcurrentResultMethodParameter returnType ) {
203
201
super (new Callable <Object >() {
204
202
@ Override
@@ -242,8 +240,9 @@ public <A extends Annotation> A getMethodAnnotation(Class<A> annotationType) {
242
240
}
243
241
}
244
242
243
+
245
244
/**
246
- * MethodParameter sub-class based on the actual return value type or if
245
+ * MethodParameter subclass based on the actual return value type or if
247
246
* that's null falling back on the generic type within the declared async
248
247
* return type, e.g. Foo instead of {@code DeferredResult<Foo>}.
249
248
*/
@@ -253,7 +252,6 @@ private class ConcurrentResultMethodParameter extends HandlerMethodParameter {
253
252
254
253
private final ResolvableType returnType ;
255
254
256
-
257
255
public ConcurrentResultMethodParameter (Object returnValue ) {
258
256
super (-1 );
259
257
this .returnValue = returnValue ;
@@ -262,7 +260,7 @@ public ConcurrentResultMethodParameter(Object returnValue) {
262
260
263
261
@ Override
264
262
public Class <?> getParameterType () {
265
- return (returnValue != null ? returnValue .getClass () : this .returnType .getRawClass ());
263
+ return (this . returnValue != null ? this . returnValue .getClass () : this .returnType .getRawClass ());
266
264
}
267
265
268
266
@ Override
0 commit comments