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

Assign GlobalConfiguration initializer to unused variable #2742

Merged
merged 1 commit into from Aug 30, 2022

Conversation

kluever
Copy link
Contributor

@kluever kluever commented Aug 30, 2022

(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

(This silences some errorprone static analysis about calling constructors w/o using the new object.)
@TimvdLippe
Copy link
Contributor

Is this coming in a future release of ErrorProne? We use ErrorProne ourselves, but it doesn't appear to be catching this problem.

@kluever
Copy link
Contributor Author

kluever commented Aug 30, 2022

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.

@TimvdLippe
Copy link
Contributor

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.

Copy link
Contributor

@TimvdLippe TimvdLippe left a 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.

@TimvdLippe TimvdLippe merged commit 530558a into mockito:main Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants