Skip to content
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

don't use TempDirNonFinal on method parameters #484

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

Bananeweizen
Copy link
Contributor

Fixes #483.

What's changed?

apply TempDirNonFinal only to fields, not method parameters
Without the main code fix, the modified test fails.

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

The method for detecting whether the variables are fields or method arguments has been copied from another recipe. There are multiple (different) implementations of this method all over the place, and I have no idea if the other implementations are better or not. Someone from the core team might want to introduce an actual API method for that to avoid these local duplicates.

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
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Some suggestions could not be made:

  • src/main/java/org/openrewrite/java/testing/junit5/TempDirNonFinal.java
    • lines 18-22

@timtebeek timtebeek self-requested a review February 20, 2024 14:49
@timtebeek timtebeek added the bug Something isn't working label Feb 20, 2024
Copy link
Contributor

@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 for the immediate fix!

@timtebeek timtebeek merged commit 65053ab into openrewrite:main Feb 20, 2024
2 checks passed
@Bananeweizen Bananeweizen deleted the tempdirnonfinal branch February 20, 2024 15:18
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.

TempDirNonFinal wrongly modifies method parameters
2 participants