-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Open
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
org.springframework.core.convert.converter.Converter is in a @NullMarked package, so all types are @NonNull by default.
All uses of T are @Nullable, but the type parameter itself is not. This leads to non-intuitive code such as:
Converter<@NonNull Source, @NonNull Target> converter;
// ...
@Nullable Target t = converter.convert(s);The convert method itself ends up annotated as @Nullable @NonNull T.
As far as I can see, the solution is to just annotate the parameter declaration, and nothing should break?
public interface Converter<S, @Nullable T> {Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement