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,10 +833,15 @@ 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 {
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);
MutablePropertyValues pvs = new MutablePropertyValues();