Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document null input requirements in Converter [SPR-12780] #17378

Closed
spring-projects-issues opened this issue Mar 3, 2015 · 1 comment
Closed
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: task A general task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

M. Justin opened SPR-12780 and commented

Looking at the JavaDocs for Converter, I see no mention about whether an implementation of the interface should expect to handle null values. However, the Spring Framework documentation indicates that "for each call to convert(S), the source argument is guaranteed to be NOT null."

It would be therefore useful if the expected null input behavior was called out explicitly in the Javadoc, so that implementors of the interface would know they should not put in null checks. Instead, they currently have to look in another source of documentation (not linked from the JavaDoc) to determine how they are expected to implement the interface.


Affects: 3.2.13, 4.1.5

Referenced from: commits ff76be2, 5f30575, dcb1145

Backported to: 3.2.14

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've added a not-null hint to the parameter javadoc, and also clarified that a converter may potentially (even if rarely) return null for any given value.

Juergen

@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches in: core Issues in core modules (aop, beans, core, context, expression) type: task A general task labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.1.6 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants