Consistent instanceof/casting of Class references

This commit is contained in:
Juergen Hoeller
2016-10-30 21:40:27 +01:00
parent 7627c38695
commit ac80ac6f8b
13 changed files with 35 additions and 39 deletions

View File

@@ -50,7 +50,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
private static final Mono<Object[]> NO_ARGS = Mono.just(new Object[0]);
private final static Object NO_VALUE = new Object();
private static final Object NO_VALUE = new Object();
private List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>();
@@ -101,8 +101,8 @@ public class InvocableHandlerMethod extends HandlerMethod {
return Mono.error(ex.getTargetException());
}
catch (Throwable ex) {
String s = getInvocationErrorMessage(args);
return Mono.error(new IllegalStateException(s));
String msg = getInvocationErrorMessage(args);
return Mono.error(new IllegalStateException(msg));
}
});
}

View File

@@ -198,7 +198,7 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
*/
private RequestMappingInfo createRequestMappingInfo(AnnotatedElement element) {
RequestMapping requestMapping = AnnotatedElementUtils.findMergedAnnotation(element, RequestMapping.class);
RequestCondition<?> condition = (element instanceof Class<?> ?
RequestCondition<?> condition = (element instanceof Class ?
getCustomTypeCondition((Class<?>) element) : getCustomMethodCondition((Method) element));
return (requestMapping != null ? createRequestMappingInfo(requestMapping, condition) : null);
}