Leniently accept custom DeferredResult etc subclasses for null values
Issue: SPR-14423
(cherry picked from commit cfc560c)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -263,16 +263,10 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod {
|
||||
if (this.returnValue != null) {
|
||||
return this.returnValue.getClass();
|
||||
}
|
||||
Class<?> parameterType = super.getParameterType();
|
||||
if (ResponseBodyEmitter.class.isAssignableFrom(parameterType) ||
|
||||
StreamingResponseBody.class.isAssignableFrom(parameterType)) {
|
||||
return parameterType;
|
||||
if (!ResolvableType.NONE.equals(this.returnType)) {
|
||||
return this.returnType.getRawClass();
|
||||
}
|
||||
if (ResolvableType.NONE.equals(this.returnType)) {
|
||||
throw new IllegalArgumentException("Expected one of Callable, DeferredResult, or ListenableFuture: " +
|
||||
super.getParameterType());
|
||||
}
|
||||
return this.returnType.getRawClass();
|
||||
return super.getParameterType();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user