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:
Juergen Hoeller 2009-09-17 15:20:04 +00:00
parent 5713ee318c
commit 56d0246713
1 changed files with 8 additions and 3 deletions

View File

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