Browse Source

turned formatter implementations non-final

3.0.x
Juergen Hoeller 16 years ago
parent
commit
41d6f8e9ed
  1. 4
      org.springframework.context/src/main/java/org/springframework/format/number/CurrencyFormatter.java
  2. 4
      org.springframework.context/src/main/java/org/springframework/format/number/NumberFormatter.java
  3. 4
      org.springframework.context/src/main/java/org/springframework/format/number/PercentFormatter.java
  4. 5
      org.springframework.context/src/main/java/org/springframework/format/support/FormattingConversionService.java

4
org.springframework.context/src/main/java/org/springframework/format/number/CurrencyFormatter.java

@ -1,5 +1,5 @@ @@ -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; @@ -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);

4
org.springframework.context/src/main/java/org/springframework/format/number/NumberFormatter.java

@ -1,5 +1,5 @@ @@ -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; @@ -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;

4
org.springframework.context/src/main/java/org/springframework/format/number/PercentFormatter.java

@ -1,5 +1,5 @@ @@ -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; @@ -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);

5
org.springframework.context/src/main/java/org/springframework/format/support/FormattingConversionService.java

@ -234,8 +234,9 @@ public class FormattingConversionService extends GenericConversionService @@ -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)) {

Loading…
Cancel
Save