Consistent processing of empty values and catching of RuntimeExceptions for Formatters

Issue: SPR-14345
This commit is contained in:
Juergen Hoeller
2016-06-09 10:49:15 +02:00
parent 8432c62b50
commit d51c22a789
8 changed files with 85 additions and 20 deletions

View File

@@ -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.
@@ -26,7 +26,7 @@ import org.springframework.util.ObjectUtils;
* @since 3.0
*/
@SuppressWarnings("serial")
public final class ConversionFailedException extends ConversionException {
public class ConversionFailedException extends ConversionException {
private final TypeDescriptor sourceType;

View File

@@ -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.
@@ -25,7 +25,7 @@ package org.springframework.core.convert;
* @since 3.0
*/
@SuppressWarnings("serial")
public final class ConverterNotFoundException extends ConversionException {
public class ConverterNotFoundException extends ConversionException {
private final TypeDescriptor sourceType;
@@ -33,7 +33,7 @@ public final class ConverterNotFoundException extends ConversionException {
/**
* Creates a new conversion executor not found exception.
* Create a new conversion executor not found exception.
* @param sourceType the source type requested to convert from
* @param targetType the target type requested to convert to
*/

View File

@@ -38,7 +38,7 @@ abstract class ConversionUtils {
catch (ConversionFailedException ex) {
throw ex;
}
catch (Exception ex) {
catch (Throwable ex) {
throw new ConversionFailedException(sourceType, targetType, source, ex);
}
}