Skip to content

Prevent NPE in FindAndReplaceLiteral when literal value is null #5582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2025

Conversation

e5LA
Copy link
Contributor

@e5LA e5LA commented Jun 9, 2025

What's changed?

This PR fixes NullPointerException in the FindAndReplaceLiteral recipe when literal.getValue() is null

What's your motivation?

Fixes #5579

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

Copy link
Member

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the quick fix here @e5LA !

@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Jun 9, 2025
@timtebeek timtebeek merged commit 597ce61 into openrewrite:main Jun 9, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Jun 9, 2025
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.

Find And Replace Literal Recipe throws NullPointerException
2 participants