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

Prefer JDK methods for Maps and Sets of an expected size #651

Merged
merged 5 commits into from
Jan 2, 2025

Conversation

timtebeek
Copy link
Contributor

@timtebeek timtebeek commented Jan 1, 2025

What's changed?

  • Phase out Guava methods that create Maps and Sets of an expected size.
  • Add preconditions to the NoGuavaJava11 and NoGuavaJava21 recipes
  • Include NoGuavaJava11 and NoGuavaJava21 with NoGuava for easier running
  • Remove inclusion of NoGuavaJava11 from NoGuavaJava21
  • Remove inclusion of NoGuava from NoGuavaJava11
  • Include tech.picnic.errorprone.refasterrules.InputStreamRulesRecipes

What's your motivation?

Further the phase out of Guava methods, as seen on

Anyone you would like to review specifically?

As suggested by @knutwannheden

Have you considered any alternatives or workarounds?

Declarative didn't work as we swap a method invocation for a constructor call.
Refaster didn't work as we do not yet support generics needed here.

Any additional context

There's additional rules added we could still phase out:
gaul/modernizer-maven-plugin@modernizer-maven-plugin-2.9.0...modernizer-maven-plugin-3.0.0

@timtebeek timtebeek added enhancement New feature or request recipe Recipe requested labels Jan 1, 2025
@timtebeek timtebeek self-assigned this Jan 1, 2025
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/test/java/org/openrewrite/java/migrate/guava/NoGuavaTest.java
    • lines 19-18

@timtebeek timtebeek merged commit 8428e3a into main Jan 2, 2025
2 checks passed
@timtebeek timtebeek deleted the map-and-set-of-size branch January 2, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request recipe Recipe requested
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant