@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2010 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.
@ -39,7 +39,7 @@ import org.springframework.util.ClassUtils;
* @see #setLenient
* @see #setRoundingMode
*/
public final class CurrencyFormatter extends AbstractNumberFormatter {
public class CurrencyFormatter extends AbstractNumberFormatter {
private static final boolean roundingModeOnDecimalFormat =
ClassUtils.hasMethod(DecimalFormat.class, "setRoundingMode", RoundingMode.class);
@ -34,7 +34,7 @@ import java.util.Locale;
* @see #setPattern
public final class NumberFormatter extends AbstractNumberFormatter {
public class NumberFormatter extends AbstractNumberFormatter {
private String pattern;
@ -32,7 +32,7 @@ import java.util.Locale;
* @since 3.0
public final class PercentFormatter extends AbstractNumberFormatter {
public class PercentFormatter extends AbstractNumberFormatter {
protected NumberFormat getNumberFormat(Locale locale) {
NumberFormat format = NumberFormat.getPercentInstance(locale);
@ -234,8 +234,9 @@ public class FormattingConversionService extends GenericConversionService
Object result;
try {
result = this.parser.parse(text, LocaleContextHolder.getLocale());
} catch (ParseException e) {
throw new IllegalArgumentException("Unable to parse '" + text + "'", e);
}
catch (ParseException ex) {
throw new IllegalArgumentException("Unable to parse '" + text + "'", ex);
TypeDescriptor resultType = TypeDescriptor.valueOf(result.getClass());
if (!resultType.isAssignableTo(targetType)) {