Skip to content

xds: fix style - #6834

Merged
creamsoup merged 1 commit into
grpc:masterfrom
creamsoup:lint
Mar 16, 2020
Merged

xds: fix style#6834
creamsoup merged 1 commit into
grpc:masterfrom
creamsoup:lint

Conversation

@creamsoup

Copy link
Copy Markdown
Contributor

No description provided.

@creamsoup
creamsoup requested a review from voidzcy March 16, 2020 19:15
@Override
public int hashCode() {
return Objects.hash(targets);
return Objects.hashCode(targets);

@voidzcy voidzcy Mar 16, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am confused. In @dapengzhang0 's recent PR, he explicitly changed usages of Objects.hashCode() to Objects.hash(). So which one on earth should we use?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

according to the linter both generates same value. but hash accepts vararg, so it creates unnecessary objects when calling this method. the object is not really used in the hash based collection so it doesn't really matter tbh.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The recent PR was changing from guava Objects to java.util.Objects. It's a different issue.

@creamsoup
creamsoup merged commit 58e6ad7 into grpc:master Mar 16, 2020
@creamsoup
creamsoup deleted the lint branch March 16, 2020 19:47
@lock lock Bot locked as resolved and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants