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

Add refaster recipes to simplify expected value #475

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

timo-abele
Copy link
Contributor

What's changed?

3 simple refaster recipes added

What's your motivation?

salvaging the changes in #472
adding missing transformations I noticed.

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

These recipes are simpler that the ones in #472: they don't need generics and should work in Java 8. But each test yields:

Recipe was expected to make a change but made no changes.

Anyone you would like to review specifically?

@timtebeek

Have you considered any alternatives or workarounds?

SimplifyChainedAssertJAssertion could probably be extended to cover these cases, but I think refaster is the appropriate level of complexity

Any additional context

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

timtebeek and others added 2 commits February 7, 2024 01:23
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@timtebeek timtebeek added the recipe Recipe request label Feb 7, 2024
public class SimplifyToIsZero {

@BeforeTemplate
void before(Integer i) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you want to use primitive types in the method signatures.

Copy link
Contributor Author

@timo-abele timo-abele Feb 7, 2024

Choose a reason for hiding this comment

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

I tried it for both "Integer" recipes, but still get "Recipe was expected to make a change but made no changes." for all three tests.

@timtebeek timtebeek removed their request for review March 15, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
recipe Recipe request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants