Closed
Description
@Configuration
public class ConverterConfig {
@Bean
public Converter<String, LocalDate> localDateConverter() {
return source -> LocalDate.parse(source, CommonConstants.DATE_FORMATTER);
// return new Converter<String, LocalDate>() {
// @Override
// public LocalDate convert(String source) {
// return LocalDate.parse(source, CommonConstants.DATE_FORMATTER);
// }
// };
}
}
start app successfully when add converter without the lambda exp.otherwise,failed to start app and the following result will be outputted.
Can't spring boot infer the type from the lambda exp?
Caused by: java.lang.IllegalArgumentException: Unable to determine source type <S> and target type <T> for your Converter [org.hoysing.stress.converter.ConverterConfig$$Lambda$1601/1414642952]; does the class parameterize those types?