GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Assign GlobalConfiguration initializer to unused variable by kluever · Pull Request #2742 · mockito/mockito

Conversation

@kluever

@kluever kluever commented Aug 30, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

(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.

All reactions
@kluever
Assign GlobalConfiguration initializer to unused variable
d68af08
(This silences some errorprone static analysis about calling constructors w/o using the new object.)
@TimvdLippe

TimvdLippe commented Aug 30, 2022

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kluever

kluever commented Aug 30, 2022

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@TimvdLippe

TimvdLippe commented Aug 30, 2022

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TimvdLippe
TimvdLippe approved these changes Aug 30, 2022
View reviewed changes

@TimvdLippe TimvdLippe left a comment

Copy link
Copy Markdown
Contributor

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.

All reactions
@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

Reviewers

1 more reviewer
@TimvdLippe TimvdLippe TimvdLippe approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

2 participants

@kluever @TimvdLippe
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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.