From 41d6f8e9ed6cfb3e55eedf40e2c733c25911e2c0 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 23 Jun 2010 19:34:29 +0000 Subject: [PATCH] turned formatter implementations non-final --- .../org/springframework/format/number/CurrencyFormatter.java | 4 ++-- .../org/springframework/format/number/NumberFormatter.java | 4 ++-- .../org/springframework/format/number/PercentFormatter.java | 4 ++-- .../format/support/FormattingConversionService.java | 5 +++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/org.springframework.context/src/main/java/org/springframework/format/number/CurrencyFormatter.java b/org.springframework.context/src/main/java/org/springframework/format/number/CurrencyFormatter.java index 417a824cd66..c540d74d389 100644 --- a/org.springframework.context/src/main/java/org/springframework/format/number/CurrencyFormatter.java +++ b/org.springframework.context/src/main/java/org/springframework/format/number/CurrencyFormatter.java @@ -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); diff --git a/org.springframework.context/src/main/java/org/springframework/format/number/NumberFormatter.java b/org.springframework.context/src/main/java/org/springframework/format/number/NumberFormatter.java index 91e4af0e88e..1854a2e9d0f 100644 --- a/org.springframework.context/src/main/java/org/springframework/format/number/NumberFormatter.java +++ b/org.springframework.context/src/main/java/org/springframework/format/number/NumberFormatter.java @@ -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; diff --git a/org.springframework.context/src/main/java/org/springframework/format/number/PercentFormatter.java b/org.springframework.context/src/main/java/org/springframework/format/number/PercentFormatter.java index cfdf720f120..6e9cb946ef7 100644 --- a/org.springframework.context/src/main/java/org/springframework/format/number/PercentFormatter.java +++ b/org.springframework.context/src/main/java/org/springframework/format/number/PercentFormatter.java @@ -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); diff --git a/org.springframework.context/src/main/java/org/springframework/format/support/FormattingConversionService.java b/org.springframework.context/src/main/java/org/springframework/format/support/FormattingConversionService.java index 3e3ad01e3b8..5749c249c11 100644 --- a/org.springframework.context/src/main/java/org/springframework/format/support/FormattingConversionService.java +++ b/org.springframework.context/src/main/java/org/springframework/format/support/FormattingConversionService.java @@ -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)) {