turned formatter implementations non-final

This commit is contained in:
Juergen Hoeller
2010-06-23 19:34:29 +00:00
parent 0d7ce3eac5
commit 41d6f8e9ed
4 changed files with 9 additions and 8 deletions

View File

@@ -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);

View File

@@ -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.
@@ -34,7 +34,7 @@ import java.util.Locale;
* @see #setPattern
* @see #setLenient
*/
public final class NumberFormatter extends AbstractNumberFormatter {
public class NumberFormatter extends AbstractNumberFormatter {
private String pattern;

View File

@@ -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.
@@ -32,7 +32,7 @@ import java.util.Locale;
* @since 3.0
* @see #setLenient
*/
public final class PercentFormatter extends AbstractNumberFormatter {
public class PercentFormatter extends AbstractNumberFormatter {
protected NumberFormat getNumberFormat(Locale locale) {
NumberFormat format = NumberFormat.getPercentInstance(locale);

View File

@@ -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)) {