Merge pull request #94 from dsyer/SPR-9498

SPR-9498: relax logic detecting successful property editor after conversion exception
This commit is contained in:
jhoeller
2012-09-04 08:54:01 -07:00
5 changed files with 45 additions and 2 deletions

View File

@@ -44,6 +44,7 @@ import org.springframework.util.StringUtils;
*
* @author Juergen Hoeller
* @author Rob Harrop
* @author Dave Syer
* @since 2.0
* @see BeanWrapperImpl
* @see SimpleTypeConverter
@@ -244,7 +245,7 @@ class TypeConverterDelegate {
}
if (firstAttemptEx != null) {
if (editor == null && convertedValue == newValue) {
if (editor == null && convertedValue == newValue && requiredType!=null && !ClassUtils.isAssignableValue(requiredType, convertedValue)) {
throw firstAttemptEx;
}
logger.debug("Original ConversionService attempt failed - ignored since " +