Skip to content

Conversation

timtebeek
Copy link
Member

What's changed?

Added recipes for these two transformations
com.google.common.base.Preconditions.checkNotNull -> Objects.requireNonNull
com.google.common.base.Charsets.UTF_8 -> java.nio.charset.StandardCharsets.UTF_8

What's your motivation?

As discovered on wiremock/wiremock#2111 (comment)

com.google.common.base.Preconditions.checkNotNull -> Objects.requireNonNull
com.google.common.base.Charsets.UTF_8 -> java.nio.charset.StandardCharsets.UTF_8
Copy link
Contributor

@knutwannheden knutwannheden left a comment

Choose a reason for hiding this comment

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

Not quite sure about my comments. But maybe we can add a test to verify.

@timtebeek
Copy link
Member Author

Not quite sure about my comments. But maybe we can add a test to verify.

Thanks! Fixed now.. Also reduced the scope as we can't exactly match one of the replacements, and it's not worth adding a dedicated recipe just yet.

@timtebeek timtebeek requested a review from knutwannheden June 14, 2023 08:48
Copy link
Contributor

@knutwannheden knutwannheden left a comment

Choose a reason for hiding this comment

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

👍

@timtebeek timtebeek merged commit 112b1ea into main Jun 14, 2023
@timtebeek timtebeek deleted the tim/prefer_objects_and_standard_charsets branch June 14, 2023 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

recipe Recipe requested

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants