Skip to content

Correct function types in ClassPath to avoid nullability warning - #51091

Merged
snicoll merged 1 commit into
spring-projects:4.0.xfrom
msridhar:nullaway-method-ref-warning
Jul 23, 2026
Merged

snicoll merged 1 commit into
spring-projects:4.0.xfrom
msridhar:nullaway-method-ref-warning

Conversation

@msridhar

Copy link
Copy Markdown
Contributor

Previously, the first parameter of ClassPath.of was UnaryOperator<@Nullable String>, which is equivalent to Function<@Nullable String, @Nullable String>. But, System::getProperty was passed in at a call, and that function cannot accept null as a parameter. Address by changing the relevant parameter types to Function<String, @Nullable String>.

This issue was discovered while working on NullAway, and will cause a warning in a future version of NullAway.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. label Jul 21, 2026
@msridhar
msridhar marked this pull request as draft July 21, 2026 17:37
@msridhar
msridhar force-pushed the nullaway-method-ref-warning branch from fc07209 to aff45bd Compare July 21, 2026 17:41
@msridhar
msridhar marked this pull request as ready for review July 21, 2026 18:35
@wilkinsona wilkinsona added type: task A general task and removed status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. labels Jul 22, 2026
@wilkinsona wilkinsona added this to the 4.0.x milestone Jul 22, 2026
@snicoll
snicoll force-pushed the nullaway-method-ref-warning branch from aff45bd to b6f117c Compare July 23, 2026 10:24
@snicoll
snicoll changed the base branch from main to 4.0.x July 23, 2026 10:24
@snicoll snicoll self-assigned this Jul 23, 2026
@snicoll snicoll modified the milestones: 4.0.x, 4.0.8 Jul 23, 2026
@snicoll
snicoll merged commit 38e03cf into spring-projects:4.0.x Jul 23, 2026
3 checks passed
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