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

Implement DeprecatedGuavaObjects error-prone migration #1521

Merged
merged 2 commits into from
Oct 22, 2020

Conversation

carterkozak
Copy link
Contributor

==COMMIT_MSG==
Implement DeprecatedGuavaObjects error-prone migration
==COMMIT_MSG==

@changelog-app
Copy link

changelog-app bot commented Oct 22, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Implement DeprecatedGuavaObjects error-prone migration

Check the box to generate changelog(s)

  • Generate changelog entry

.named("equal");
private static final Matcher<ExpressionTree> HASH_CODE_MATCHER = MethodMatchers.staticMethod()
.onClass("com.google.common.base.Objects")
.named("hashCode");
Copy link
Contributor

Choose a reason for hiding this comment

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

should we treat single arg version differently to map to java.util.Objects.hashCode(Object) and varargs maps to java.util.Objects.hash(Objects...)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was planning to keep this simple as a direct migration and write a separate check for java.util.Objects.hash(value) -> java.util.Objects.hashCode(value) to eventually resolve to the ideal implementation.

That would result in the first refactor run failing in this case, so it might be fine to share the complexity with this check as well. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 your proposal makes sense to me and is additive beyond just the Guava -> java.util conversion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is #1522

@bulldozer-bot bulldozer-bot bot merged commit 55df9b4 into develop Oct 22, 2020
@bulldozer-bot bulldozer-bot bot deleted the ckozak/DeprecatedGuavaObjects branch October 22, 2020 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants