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

[BEAM-3606] Remove guava-testlib from sdks/java/core main dependency set #8759

Merged
merged 1 commit into from Jun 4, 2019

Conversation

lukecwik
Copy link
Member

@lukecwik lukecwik commented Jun 4, 2019

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:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- ---
Java Build Status Build Status Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status
Python Build Status
Build Status
--- Build Status
Build Status
Build Status --- --- ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

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.
@lukecwik
Copy link
Member Author

lukecwik commented Jun 4, 2019

R: @youngoli @Ardagan

Copy link
Contributor

@youngoli youngoli left a 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) {
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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) {
Copy link
Contributor

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)

Copy link
Member Author

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.

@lukecwik lukecwik merged commit 19a45bf into apache:master Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants