spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/CharSequenceToObjectConverter.java
/**
	 * Return if String based conversion is better based on the target type. This is
	 * required when ObjectTo... conversion produces incorrect results.
	 * @param sourceType the source type to test
	 * @param targetType the target type to test
	 * @return if string conversion is better
	 */
Return if String based conversion is better based on the target type. This is
required when ObjectTo... conversion produces incorrect results.
@param sourceType the source type to test
@param targetType the target type to test
@return if string conversion is better
Return if String based conversion is better based on the target type . This is required when ObjectTo ... conversion produces incorrect results . @param sourceType the source type to test @param targetType the target type to test @return if string conversion is better
private boolean isStringConversionBetter(TypeDescriptor sourceType, TypeDescriptor targetType) {
		if (this.conversionService instanceof ApplicationConversionService) {
			ApplicationConversionService applicationConversionService = (ApplicationConversionService) this.conversionService;
			if (applicationConversionService.isConvertViaObjectSourceType(sourceType, targetType)) {
				return true;
			}
		}
		if ((targetType.isArray() || targetType.isCollection()) && !targetType.equals(BYTE_ARRAY)) {
			return true;
		}
		return false;
	}
private boolean isStringConversionBetter ( TypeDescriptor sourceType , TypeDescriptor targetType ) { if ( this . conversionService instanceof ApplicationConversionService ) { ApplicationConversionService applicationConversionService = ( ApplicationConversionService ) this . conversionService ; if ( applicationConversionService . isConvertViaObjectSourceType ( sourceType , targetType ) ) { return true ; } } if ( ( targetType . isArray ( ) || targetType . isCollection ( ) ) && ! targetType . equals ( BYTE_ARRAY ) ) { return true ; } return false ; }
Return if String based conversion is better based on the target type.
Return if String based conversion is better based on the target type .
// If an ObjectTo... converter is being used then there might be a better // StringTo... version // StringToArrayConverter / StringToCollectionConverter are better than // ObjectToArrayConverter / ObjectToCollectionConverter