adapted to Converter signature change

This commit is contained in:
Juergen Hoeller 2009-09-17 15:20:04 +00:00
parent 6f2642f2d3
commit 9ef1d2b1ad
1 changed files with 8 additions and 3 deletions

View File

@ -833,9 +833,14 @@ public final class DefaultListableBeanFactoryTests {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
DefaultConversionService conversionService = new DefaultConversionService(); DefaultConversionService conversionService = new DefaultConversionService();
conversionService.addConverter(new Converter<String, Float>() { conversionService.addConverter(new Converter<String, Float>() {
public Float convert(String source) throws Exception { public Float convert(String source) {
NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN); try {
return nf.parse(source).floatValue(); NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
return nf.parse(source).floatValue();
}
catch (ParseException ex) {
throw new IllegalArgumentException(ex);
}
} }
}); });
lbf.setConversionService(conversionService); lbf.setConversionService(conversionService);