Polishing
This commit is contained in:
parent
3a518b60e7
commit
398cc01650
|
@ -59,11 +59,9 @@ class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware {
|
|||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
if (beanFactory instanceof ConfigurableBeanFactory) {
|
||||
Object typeConverter = ((ConfigurableBeanFactory) beanFactory).getTypeConverter();
|
||||
if (typeConverter instanceof SimpleTypeConverter) {
|
||||
delegate = (SimpleTypeConverter) typeConverter;
|
||||
}
|
||||
if (beanFactory instanceof ConfigurableBeanFactory cbf &&
|
||||
cbf.getTypeConverter() instanceof SimpleTypeConverter simpleTypeConverter) {
|
||||
this.delegate = simpleTypeConverter;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +84,6 @@ class BeanFactoryTypeConverter implements TypeConverter, BeanFactoryAware {
|
|||
if (conversionService.canConvert(sourceTypeDescriptor, targetTypeDescriptor)) {
|
||||
return true;
|
||||
}
|
||||
// TODO: what does this mean? This method is not used in SpEL so probably ignorable?
|
||||
Class<?> sourceType = sourceTypeDescriptor.getObjectType();
|
||||
Class<?> targetType = targetTypeDescriptor.getObjectType();
|
||||
return canConvert(sourceType, targetType);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 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.
|
||||
|
@ -53,7 +53,7 @@ import org.springframework.web.server.ServerWebExchange;
|
|||
* {@code HandlerResultHandler} that encapsulates the view resolution algorithm
|
||||
* supporting the following return types:
|
||||
* <ul>
|
||||
* <li>{@link Void} or no value -- default view name</li>
|
||||
* <li>{@link Void}, {@code void}, or no value -- default view name</li>
|
||||
* <li>{@link String} -- view name unless {@code @ModelAttribute}-annotated
|
||||
* <li>{@link View} -- View to render with
|
||||
* <li>{@link Model} -- attributes to add to the model
|
||||
|
|
Loading…
Reference in New Issue