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

[java] Implement equals() and hashCode() in Select element wrapper #6617

Merged
merged 1 commit into from
Nov 14, 2018

Conversation

valfirst
Copy link
Contributor

@valfirst valfirst commented Nov 3, 2018


This change is Reviewable

@valfirst valfirst force-pushed the add-equals-hashcode-to-select branch from 1213fbd to 032f28a Compare November 5, 2018 20:42
@p0deje p0deje added the C-java label Nov 7, 2018

@Override
public boolean equals(Object o) {
if (this == o) {
Copy link
Member

Choose a reason for hiding this comment

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

Nowadays, we tend to follow a pattern of:

if (!(o instanceof Select)) {
  return false;
}
Select that = (Select) o;
return Objects.equals(this.element, that.element);

Copy link
Member

Choose a reason for hiding this comment

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

The performance is dramatically different, but we strip more boilerplate this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shs96c updated to follow project patterns

@valfirst valfirst force-pushed the add-equals-hashcode-to-select branch from 032f28a to 3672e66 Compare November 7, 2018 16:50
@valfirst valfirst force-pushed the add-equals-hashcode-to-select branch from 3672e66 to 38721f8 Compare November 13, 2018 22:07
@shs96c shs96c merged commit fc54cd2 into SeleniumHQ:master Nov 14, 2018
shs96c pushed a commit to shs96c/selenium that referenced this pull request Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants