Skip to content

Conversation

@AlejandroBertolo
Copy link
Contributor

@AlejandroBertolo AlejandroBertolo commented Oct 2, 2023

What's changed?

Variables identified as fields of anonymous classes will be skipped in FinalizeLocalVariables recipe.

What's your motivation?

Fixes #181

Anything in particular you'd like reviewers to focus on?

There is perhaps a better way of identifying anonymous classes.

Anyone you would like to review specifically?

@timtebeek

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've added the license header to any new files through ./gradlew licenseFormat
  • no new files were added
  • I've used the IntelliJ IDEA auto-formatter on affected files

@AlejandroBertolo AlejandroBertolo changed the title fix: skip finalizing anonymous class fields fix: skip finalizing anonymous class fields in FinalizeLocalVariables Oct 2, 2023
@AlejandroBertolo
Copy link
Contributor Author

Found a simpler way to identify anonymous class parents, as seen in MissingOverrideAnnotation recipe.
Should do the trick.

@timtebeek timtebeek added the bug Something isn't working label Oct 2, 2023
@timtebeek
Copy link
Member

Thanks for the quick work on this!

@timtebeek timtebeek merged commit ad96b86 into openrewrite:main Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

FinalizeLocalVariables fails when processing fields of anonymous classes

2 participants