You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find this type of improvement as valid one and enough simple.
And yes, it really will help to make that Lambda generics for development time from IDE.
At runtime the ConverterAdapter doesn't take care about generics from provided Converter and just relies on those Class<?> arguments.
No need to worry that we won't have generics in the Lambda in this case!
Rolled into 4.3 now. Custom ConverterRegistry implementations might have to adapt their implementation signature at the source level; the change should be binary compatible in an case.
Byron Ellacott opened SPR-12948 and commented
The type signature for
addConverter
would be more convenient for Java 8 lambda syntax sugar if the types were connected:This would allow, eg:
The current signature means the type of the third argument cannot be inferred by the compiler, so lambdas must be explicit:
Note that even in this form, the lambda argument must be explicitly typed.
Reference URL: https://github.com/spring-projects/spring-framework/blob/master/spring-core/src/main/java/org/springframework/core/convert/support/GenericConversionService.java#L106
Referenced from: commits 8a69159
The text was updated successfully, but these errors were encountered: