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 from a5f9e9d to 4fa3f59 Compare March 27, 2026 15:30
Signed-off-by: Manu Sridharan <msridhar@gmail.com>
@msridhar msridhar force-pushed the address-upcoming-nullaway-warning branch from 4fa3f59 to 47750e1 Compare March 29, 2026 16:54
@msridhar
Copy link
Copy Markdown
Contributor Author

FYI @sdeleuze

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

Labels

status: waiting-for-triage An issue we've not yet triaged or decided on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants