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

API, Core: Fix errorprone warnings #9419

Merged
merged 3 commits into from Jan 10, 2024
Merged

API, Core: Fix errorprone warnings #9419

merged 3 commits into from Jan 10, 2024

Conversation

ajantha-bhat
Copy link
Member

./gradlew clean build -x test is reporting some warnings as seen below.

Screenshot 2024-01-05 at 2 28 46 PM

After this PR, ./gradlew clean build -x test is green.

@@ -166,6 +166,7 @@ public void clear() {
wrapperSet.clear();
}

@SuppressWarnings("CollectionUndefinedEquality")
Copy link
Member Author

Choose a reason for hiding this comment

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

containsAll uses CharSequenceWrapper for equals to ensure consistent
hashing and equals behaviour similar to CharSequenceMap (javadoc of CharSequenceMap explains it). But the tool is unable to figure it out I guess. Hence, suppressing here and below two places.

@@ -54,7 +54,7 @@ public boolean equals(Object other) {
CharSequenceWrapper that = (CharSequenceWrapper) other;

if (wrapped instanceof String && that.wrapped instanceof String) {
return wrapped.equals(that.wrapped);
return wrapped.toString().contentEquals(that.wrapped);
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for looking into this @ajantha-bhat, but there is a fair chance that this was intentional for performance reasons.

Copy link
Member Author

Choose a reason for hiding this comment

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

I see. We can suppress the warning in that case then.
@aokolnychyi: Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Reverted the fix and suppressed instead.

@ajantha-bhat
Copy link
Member Author

cc: @aokolnychyi

@ajantha-bhat
Copy link
Member Author

Retriggering build due to flaky test

Copy link
Contributor

@aokolnychyi aokolnychyi 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 to me, I am not sure about one comment.

I was meaning to do this, thanks @ajantha-bhat!

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this @ajantha-bhat and @aokolnychyi for the review 👍

@Fokko Fokko merged commit c6a7726 into apache:main Jan 10, 2024
42 checks passed
geruh pushed a commit to geruh/iceberg that referenced this pull request Jan 26, 2024
* API, Core: Fix errorprone warnings

* Address comments

* Remove comment
adnanhemani pushed a commit to adnanhemani/iceberg that referenced this pull request Jan 30, 2024
* API, Core: Fix errorprone warnings

* Address comments

* Remove comment
devangjhabakh pushed a commit to cdouglas/iceberg that referenced this pull request Apr 22, 2024
* API, Core: Fix errorprone warnings

* Address comments

* Remove comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants