adapted to Converter signature change
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1908 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
5713ee318c
commit
56d0246713
|
|
@ -833,9 +833,14 @@ public final class DefaultListableBeanFactoryTests {
|
|||
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
|
||||
DefaultConversionService conversionService = new DefaultConversionService();
|
||||
conversionService.addConverter(new Converter<String, Float>() {
|
||||
public Float convert(String source) throws Exception {
|
||||
NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
|
||||
return nf.parse(source).floatValue();
|
||||
public Float convert(String source) {
|
||||
try {
|
||||
NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
|
||||
return nf.parse(source).floatValue();
|
||||
}
|
||||
catch (ParseException ex) {
|
||||
throw new IllegalArgumentException(ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
lbf.setConversionService(conversionService);
|
||||
|
|
|
|||
Loading…
Reference in New Issue