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

Introduce a dedicated nullness API #34261

Closed
sdeleuze opened this issue Jan 14, 2025 · 0 comments
Closed

Introduce a dedicated nullness API #34261

sdeleuze opened this issue Jan 14, 2025 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@sdeleuze
Copy link
Contributor

sdeleuze commented Jan 14, 2025

As a follow-up of #28797, this issue intends to introduce a nullness API for runtime checks since MethodParameter#isOptional is not specific enough for that purpose.

Taking inspiration of spring-projects/spring-data-commons#3115 and this MethodParameter#getNullness draft, this issue intends to introduce a dedicated nullness API capable of exposing enum Nullness { UNSPECIFIED, NULLABLE, NON_NULL } for parameters and return values.

The proposed scope is full support for JSpecify + detection of any @Nullable annotation without taking care of the package (including Spring and JSR 305 ones).

The Spring Data team via @odrotbohm has asked this API should be usable without creating a MethodParameter instance, so we may introduce a NullnessUtils or similar class and related utility methods.

@sdeleuze sdeleuze added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Jan 14, 2025
@sdeleuze sdeleuze added this to the 7.0.0-M2 milestone Jan 14, 2025
@sdeleuze sdeleuze self-assigned this Jan 14, 2025
@sdeleuze sdeleuze modified the milestones: 7.0.0-M2, 7.0.0-M1 Jan 16, 2025
sdeleuze added a commit to sdeleuze/spring-framework that referenced this issue Jan 21, 2025
sdeleuze added a commit to sdeleuze/spring-framework that referenced this issue Jan 21, 2025
sdeleuze added a commit to sdeleuze/spring-framework that referenced this issue Jan 22, 2025
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) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant