Skip to content

Address nullness warning from upcoming version of NullAway#36548

Open
msridhar wants to merge 1 commit intospring-projects:mainfrom
msridhar:address-upcoming-nullaway-warning
Open

Address nullness warning from upcoming version of NullAway#36548
msridhar wants to merge 1 commit intospring-projects:mainfrom
msridhar:address-upcoming-nullaway-warning

Conversation

@msridhar
Copy link
Copy Markdown
Contributor

NullAway will emit these warnings once uber/NullAway#1499 lands:

spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java:520: error: [NullAway] referenced method returns @Nullable MultiValueMap<String, Object>, but functional interface method returns @Nullable MultiValueMap<String, @Nullable Object>, which has mismatched type parameter nullability
                                .collect(MergedAnnotationCollectors.toMultiValueMap(AnnotatedElementUtils::nullIfEmpty, adaptations));
                                                                                    ^
    (see http://t.uber.com/nullaway )
spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java:520: error: [NullAway] parameter type of referenced method is MultiValueMap<String, Object>, but parameter in functional interface method has type MultiValueMap<String, @Nullable Object>, which has mismatched type parameter nullability
                                .collect(MergedAnnotationCollectors.toMultiValueMap(AnnotatedElementUtils::nullIfEmpty, adaptations));
                                                                                    ^

This PR updates the annotations on nullIfEmpty to address these warnings.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 26, 2026
@msridhar msridhar force-pushed the address-upcoming-nullaway-warning branch 2 times, most recently from 4fa3f59 to 47750e1 Compare March 29, 2026 16:54
@msridhar
Copy link
Copy Markdown
Contributor Author

FYI @sdeleuze

Signed-off-by: Manu Sridharan <msridhar@gmail.com>
@msridhar msridhar force-pushed the address-upcoming-nullaway-warning branch from 47750e1 to 686c6de Compare April 3, 2026 19:48
@sdeleuze sdeleuze self-assigned this Apr 3, 2026
@sdeleuze sdeleuze added type: task A general task in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Apr 3, 2026
@sdeleuze sdeleuze added this to the 7.0.7 milestone Apr 3, 2026
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: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants