Skip to content

Remove @Nullable from local variable declarations#50866

Merged
wilkinsona merged 2 commits into
spring-projects:4.0.xfrom
quaff:patch-220
Jun 28, 2026
Merged

Remove @Nullable from local variable declarations#50866
wilkinsona merged 2 commits into
spring-projects:4.0.xfrom
quaff:patch-220

Conversation

@quaff

@quaff quaff commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

@Nullable and @NonNull aren't applied to local variables—at least not their root types. (They should be applied to type arguments and array components.) The reason is that it is possible to infer whether a variable can be null based on the values that are assigned to the variable.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 26, 2026
@philwebb philwebb added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 26, 2026
@philwebb philwebb added this to the 4.0.x milestone Jun 26, 2026
@wilkinsona wilkinsona changed the title Remove @Nullable on local variables Remove @Nullable from local variable declarations Jun 27, 2026
@wilkinsona wilkinsona self-assigned this Jun 28, 2026
…ons"

See spring-projectsgh-50866

Signed-off-by: Andy Wilkinson <andy.wilkinson@broadcom.com>
@wilkinsona wilkinsona changed the base branch from main to 4.0.x June 28, 2026 11:05
@wilkinsona wilkinsona modified the milestones: 4.0.x, 4.0.8 Jun 28, 2026
@wilkinsona wilkinsona merged commit 3edbc80 into spring-projects:4.0.x Jun 28, 2026
4 checks passed
@wilkinsona

Copy link
Copy Markdown
Member

Thank you, @quaff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants