GeezerVison is showing github.com — Assign GlobalConfiguration initializer to unused variable by kluever · Pull Request #2742 · mockito/mockito
Conversation
kluever
commented
Aug 30, 2022
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
(This silences some errorprone static analysis about calling constructors w/o using the new object.)
Checklist
- Read the contributing guide
- PR should be motivated, i.e. what does it fix, why, and if relevant how
- If possible / relevant include an example in the description, that could help all readers
including project members to get a better picture of the change
- Avoid other runtime dependencies
- Meaningful commit history ; intention is important please rebase your commit history so that each
commit is meaningful and help the people that will explore a change in 2 years
- The pull request follows coding style
- Mention
Fixes #<issue number> in the description if relevant
- At least one commit should mention
Fixes #<issue number> if relevant
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
(This silences some errorprone static analysis about calling constructors w/o using the new object.)
|
Is this coming in a future release of ErrorProne? We use ErrorProne ourselves, but it doesn't appear to be catching this problem.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Inside of google we've made CheckReturnValue the default (!), and also added coverage for constructors (calling a constructor for side effects is super weird).
We haven't released those checks yet, but I imagine we will at some point. If you'd rather that we carry a local patch for this edit, that's something we can do as well...but then again, this PR is a no-op, so landing it would obviously be my preferred solution to carrying a local patch.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
No I am okay with landing this patch, since it is more descriptive what is going on. I was mostly confused as to why ErrorProne didn't catch this error for us.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks! Looking forward to the ErrorProne release as well.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.