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
[BEAM-3606] Remove guava-testlib from sdks/java/core main dependency set #8759
Conversation
This replaces the usage of an EqualsTester with our own implementation. The eventual goal is to stop shading guava as a default and then eventually to stop shading modules by default.
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.
Looks good, just recommending some small improvements.
for (int i = 0; i < equalityGroups.size(); ++i) { | ||
List<T> current = equalityGroups.get(i); | ||
for (int j = 0; j < current.size(); ++j) { | ||
for (int k = 0; k < current.size(); ++k) { |
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.
Could you do int k = j
instead here to avoid duplicate comparisons?
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.
Since equals is implemented within the class a.equals(b) is not the same thing as b.equals(a) if a and b are two different classes, we also test a.equals(a) for posterity.
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.
Ah, I didn't consider that case. Ok that makes sense now.
current.get(k)); | ||
} | ||
} | ||
for (int j = 0; j < equalityGroups.size(); ++j) { |
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.
Here too, it seems like you could just do int j = i + 1
and avoid duplicate comparisons (and self comparisons)
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.
Same reasoning about the equals as above, we ensure that they are not equals both ways as well.
This replaces the usage of an EqualsTester with our own implementation.
The eventual goal is to stop shading guava as a default and then eventually to stop shading modules by default.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.