-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Build: Fix minor error-prone warnings #6629
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
Conversation
nastra
left a comment
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.
LGTM, thanks for fixing @ajantha-bhat
|
|
||
| String[] parts = token.split("\\."); | ||
| if (parts.length != 3) { | ||
| List<String> parts = Splitter.on('.').splitToList(token); |
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 extract this to a private static final Splitter DOT_SPLITTER?
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.
As it is not used in multiple places (in the same file), I thought no need for an extra variable.
|
should we raise the severity of the |
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. |
|
if these warnings are worth fixing, shouldnt they also be worth preventing? 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. |
Fokko
left a comment
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.
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.
its probably what you mean, but instead of suppressing them (=adding annotations), if we dont agree with a check, it should be turned |
|
@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. |
* Build: Fix minor error-prone warnings * Enforce StringSplitter to avoid future warnings
* Build: Fix minor error-prone warnings * Enforce StringSplitter to avoid future warnings
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:

After:
