Skip to content

Skip UseMapOf when put() argument is a null literal#1094

Merged
timtebeek merged 1 commit into
mainfrom
tim/issue-1092
May 11, 2026
Merged

Skip UseMapOf when put() argument is a null literal#1094
timtebeek merged 1 commit into
mainfrom
tim/issue-1092

Conversation

@timtebeek
Copy link
Copy Markdown
Member

@timtebeek timtebeek commented May 11, 2026

`Map.of(..)` throws `NullPointerException` on null keys or values, so
converting a `HashMap` containing null arguments is not behavior-preserving.

Fixes #1092
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite May 11, 2026
@timtebeek timtebeek merged commit 972a519 into main May 11, 2026
1 check failed
@timtebeek timtebeek deleted the tim/issue-1092 branch May 11, 2026 11:41
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

UseMapOf converts HashMap with null keys/values to Map.of() which throws NullPointerException

1 participant