Skip to content

Conversation

@ajantha-bhat
Copy link
Member

I have observed that the build [./gradlew clean build -x test] has some warnings.
So it is an effort to keep the build green.

Before:
Screenshot 2023-01-20 at 7 50 45 AM

After:
Screenshot 2023-01-20 at 8 04 01 AM

@ajantha-bhat
Copy link
Member Author

cc: @nastra, @Fokko

Copy link
Contributor

@nastra nastra left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing @ajantha-bhat


String[] parts = token.split("\\.");
if (parts.length != 3) {
List<String> parts = Splitter.on('.').splitToList(token);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: should we extract this to a private static final Splitter DOT_SPLITTER?

Copy link
Member Author

Choose a reason for hiding this comment

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

As it is not used in multiple places (in the same file), I thought no need for an extra variable.

@XN137
Copy link
Contributor

XN137 commented Jan 23, 2023

should we raise the severity of the StringSplitter check to ERROR like here ?
this prevents similar problems from being introduced again

@ajantha-bhat
Copy link
Member Author

should we raise the severity of the StringSplitter check to ERROR like here ?
this prevents similar problems from being introduced again

We could add this. But I am not sure on what basis we add here because there are 400 plus bug patterns in errorProne. Even if we prevent this error, there can be some other error-prone warnings that can still prevent the build from looking green.

@XN137
Copy link
Contributor

XN137 commented Jan 23, 2023

if these warnings are worth fixing, shouldnt they also be worth preventing?
automatic prevention is usually cheaper than manually observing and fixing future warnings.

this also has the added benefit that we are sure this PR addressed all these types of violations, not just the ones you happened to see.

i dont see how the existence of other errorprone checks, that are not being enforced, matters in this discussion.
ideally all of the checks we agree are worth fixing should be enforced... the problem is identifying those and addressing all their current violations.

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.

Great work @ajantha-bhat. I also did quite some of these fixes because they clutter up your output when building locally and in the CI.

I agree with @XN137 that we should find some way to get rid of the warnings by either turning them into errors or if they aren't important, just suppressing them.

@XN137
Copy link
Contributor

XN137 commented Jan 23, 2023

or if they aren't important, just suppressing them.

its probably what you mean, but instead of suppressing them (=adding annotations), if we dont agree with a check, it should be turned OFF instead, so it does not add to the compile time and does not add future warnings

@ajantha-bhat
Copy link
Member Author

@Fokko, @XN137, @nastra: Thanks for the review.
I have enforced StringSplitter cases to throw the error as discussed above and the builds are passing.

@Fokko
Copy link
Contributor

Fokko commented Jan 23, 2023

@XN137 I agree with you, but there are some tricky cases where you want to use keep the check in place, but just suppress them at certain places. I think this should be checked on a per-rule basis.

@Fokko Fokko merged commit 881be5e into apache:master Jan 23, 2023
krvikash pushed a commit to krvikash/iceberg that referenced this pull request Mar 16, 2023
* Build: Fix minor error-prone warnings

* Enforce StringSplitter to avoid future warnings
zhongyujiang pushed a commit to zhongyujiang/iceberg that referenced this pull request Apr 16, 2025
* Build: Fix minor error-prone warnings

* Enforce StringSplitter to avoid future warnings
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.

4 participants