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

Upgrade Error Prone to 2.18.0 #14597

Merged
merged 4 commits into from
Jan 12, 2023
Merged

Conversation

ksobolew
Copy link
Contributor

@ksobolew ksobolew commented Oct 12, 2022

Description

In 2.16.0 there's a new checker, LenientFormatStringValidation, ERROR by default, which verifies some more format strings in non-standard libraries (like Guava), and it triggers in several places.

In 2.17.0 there's a new checker, ImpossibleNullComparison, which triggers on some null checks of the return value from Multimap#get, which cannot be null.

In 2.18.0 the UnusedVariable checker reports unused parameters on Guava methods (@Inject or @Provides).

Non-technical explanation

Improved code quality. (Possibly preventing crashes resulting from invalid format strings in some error conditions.)

Release notes

(x) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@ksobolew ksobolew force-pushed the kudi/error-prone-2.16 branch from 6380421 to c13addb Compare October 13, 2022 09:31
@ksobolew ksobolew force-pushed the kudi/error-prone-2.16 branch from c13addb to 40f127b Compare October 13, 2022 12:05
@ksobolew
Copy link
Contributor Author

Thanks @findepi, addressed comments

@ksobolew ksobolew force-pushed the kudi/error-prone-2.16 branch from 40f127b to 69a6e1e Compare October 13, 2022 15:02
@findepi
Copy link
Member

findepi commented Oct 13, 2022

@ksobolew why rebase?
what changed?

@ksobolew
Copy link
Contributor Author

Oh, I always forget to not rebase reflexively. Sorry. I just removed one import obsoleted by the second commit.

@ksobolew ksobolew force-pushed the kudi/error-prone-2.16 branch from 69a6e1e to 5b37621 Compare October 14, 2022 07:52
@ksobolew
Copy link
Contributor Author

Just rebased on top of latest master to pull in fixes to the build scripts

@findepi
Copy link
Member

findepi commented Oct 14, 2022

the build is not green

@ksobolew
Copy link
Contributor Author

ci / test (core/trino-main):

Error:  Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project trino-main: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test failed: Cannot invoke "java.io.File.getAbsolutePath()" because the return value of "org.apache.maven.artifact.Artifact.getFile()" is null -> [Help 1]

Some kind of Maven issue - I've seen it before, but I have no idea what it is.

ci / test (plugin/trino-hive) is #14631, already fixed (needs rebase).

ci / pt (default, suite-2, ) (weird task name, BTW) is a timeout? (Failed after almost exactly 2 hours)

@ksobolew ksobolew force-pushed the kudi/error-prone-2.16 branch from 5b37621 to 98a6798 Compare October 14, 2022 15:47
@findepi findepi added the no-release-notes This pull request does not require release notes entry label Oct 17, 2022
@ksobolew
Copy link
Contributor Author

Can we merge it now?

@ksobolew ksobolew force-pushed the kudi/error-prone-2.16 branch 2 times, most recently from eaa07b2 to 8efcd6a Compare December 15, 2022 10:38
@ksobolew ksobolew force-pushed the kudi/error-prone-2.16 branch from 8efcd6a to 0743aad Compare January 5, 2023 11:21
@ksobolew ksobolew changed the title Upgrade Error Prone to 2.16.0 Upgrade Error Prone to 2.17.0 Jan 5, 2023
@ksobolew ksobolew force-pushed the kudi/error-prone-2.16 branch from 0743aad to 3b2e0bf Compare January 5, 2023 11:23
@ksobolew
Copy link
Contributor Author

ksobolew commented Jan 5, 2023

Error Prone 2.17.0 was released a couple of days ago; I merged this into this PR.

pom.xml Outdated Show resolved Hide resolved
There's a new checker in Error Prone 2.16.0,
`LenientFormatStringValidation`, ERROR by default, which verifies some
more format strings in non-standard libraries (like Guava), and it
triggers in several places.
This whole expression was evaluated eagerly for each check, even though
it was basically never used. Calling `toString()` on the raw list does
the same thing anyway.
@ksobolew ksobolew force-pushed the kudi/error-prone-2.16 branch from 6a4e38a to 9a95f49 Compare January 10, 2023 17:49
@ksobolew
Copy link
Contributor Author

Pulled the last commit from #15654

@ksobolew ksobolew changed the title Upgrade Error Prone to 2.17.0 Upgrade Error Prone to 2.18.0 Jan 10, 2023
@wendigo wendigo requested a review from kokosing January 11, 2023 14:10
@@ -905,7 +905,8 @@ private static ListMultimap<PlanNodeId, ExchangeSourceHandle> getInputsForRemote
ImmutableListMultimap.Builder<PlanNodeId, ExchangeSourceHandle> result = ImmutableListMultimap.builder();
for (RemoteSourceNode remoteSource : remoteSources) {
for (PlanFragmentId fragmentId : remoteSource.getSourceFragmentIds()) {
Collection<ExchangeSourceHandle> handles = requireNonNull(exchangeSourceHandles.get(fragmentId), () -> "exchange source handle is missing for fragment: " + fragmentId);
Collection<ExchangeSourceHandle> handles = exchangeSourceHandles.get(fragmentId);
checkArgument(!handles.isEmpty(), "exchange source handle is missing for fragment: %s", fragmentId);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd actually drop that. Previous version wouldn't throw on empty collection - this does. It's a change in the behavior.

I've asked @losipiuk and according to his understanding dropping an RNN is a correct one. We could ask @arhimondr for an opinion though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can drop that. It just looked like it's the intent of the original code.

Copy link
Member

Choose a reason for hiding this comment

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

I do not see a reason why we should expect non-empty handles here. I may be wrong though. @arhimondr ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would probably just drop this check

Copy link
Member

Choose a reason for hiding this comment

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

dropped

@wendigo wendigo requested a review from losipiuk January 12, 2023 15:11
ksobolew and others added 2 commits January 12, 2023 16:29
`Multimap#get` cannot return null; replace the null check with emptiness
check instead.

Error Prone 2.17.0 check: `ImpossibleNullComparison`.
This new version triggers on a bunch of unused parameters of Guava
methods (`@Inject` or `@Provides`).
@losipiuk losipiuk force-pushed the kudi/error-prone-2.16 branch from 9a95f49 to 2e13d5b Compare January 12, 2023 15:29
@losipiuk losipiuk merged commit 462ced0 into trinodb:master Jan 12, 2023
@github-actions github-actions bot added this to the 406 milestone Jan 12, 2023
@ksobolew ksobolew deleted the kudi/error-prone-2.16 branch January 13, 2023 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed no-release-notes This pull request does not require release notes entry
Development

Successfully merging this pull request may close these issues.

6 participants