-
Notifications
You must be signed in to change notification settings - Fork 188
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
Standardize on toString/hash/equals formats #1429
Conversation
if (numPorts != resources.numPorts) { | ||
return false; | ||
} | ||
return Double.compare(resources.diskMb, diskMb) == 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason we broke this apart?
return Objects.hash(createdAt, user, eventType, request, message); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "SingularityRequestHistory [createdAt=" + createdAt + ", user=" + user + ", eventType=" + eventType + ", request=" + request + ", message=" + message + "]"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we switch this to:
"SingularityRequestHistory{" +
"createdAt=" + createdAt +
", user=" + user +
", eventType=" + eventType +
", request=" + request+
", message=" + message +
"}";
to keep the format consistent with the others? Looks like there are a few other places using []
and formatted differently
Standardize on toString/hash/equals formats further toString unification missed one more Fix toString outside of SingularityBase Fix toString outside of SingularityBase
Updated for comments, thanks @darcatron |
🚢 |
Probably long overdue, but there is a mix of guava, java.util, string concat, etc in our override methods. This changes all of them to java.util.Objects for equals/hashCode and plain string concat for toString. This way there won't be any conflicts when guava changes class/method names etc.
replaces #1425
/cc @stevenschlansker