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

feat: no guava - java 21 version (Math.clamp) #329

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

SimonVerhoeven
Copy link
Contributor

What's changed?

Introduces a new No guava - Java 21 recipe which extends the No Guava - Java 11 recipe, and also contains a new recipe which replaces the Guava - constrainToRange with the new Java 21 clamp method.

What's your motivation?

To help people make use of core Java features.

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

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

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
  • I've used the IntelliJ IDEA auto-formatter on affected files

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.

Looking good! Thanks for spotting and fixing these.

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.

The tests could be slightly more descriptive if we add a return value for the methods, just to show that hasn't changed.

@timtebeek timtebeek merged commit c4e9680 into openrewrite:main Oct 23, 2023
1 check passed
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.

2 participants