Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,22 @@ public String toString() {

@Override
public boolean equals(Object o) {
if (super.equals(o)) {
UpdateSettingsRequest that = (UpdateSettingsRequest) o;
return Objects.equals(settings, that.settings)
&& Objects.equals(indicesOptions, that.indicesOptions)
&& Objects.equals(preserveExisting, that.preserveExisting)
&& Arrays.equals(indices, that.indices);
if (this == o) {
return true;
}
return false;
if (o == null || getClass() != o.getClass()) {
return false;
}
UpdateSettingsRequest that = (UpdateSettingsRequest) o;
return Objects.equals(settings, that.settings)
&& Objects.equals(indicesOptions, that.indicesOptions)
&& Objects.equals(preserveExisting, that.preserveExisting)
&& Arrays.equals(indices, that.indices);
Copy link
Member

Choose a reason for hiding this comment

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

don't you need to take also timeout and masterNodeTimeout into account?

Copy link
Member

Choose a reason for hiding this comment

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

I would suspect proper equals/hashcode tests to fail currently, maybe also tests need to be updated to mutate such fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now the equals and the hashCode use all request fields except for the flatSettings ( as the flatSettings are not serialized ).

}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), settings, indicesOptions, preserveExisting, Arrays.hashCode(indices));
return Objects.hash(settings, indicesOptions, preserveExisting, Arrays.hashCode(indices));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,4 @@ public void writeTo(StreamOutput out) throws IOException {
timeout.writeTo(out);
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AcknowledgedRequest<?> that = (AcknowledgedRequest<?>) o;
return Objects.equals(timeout, that.timeout);
}

@Override
public int hashCode() {
return Objects.hash(timeout);
}

}