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

Applied @CheckReturnValue to some classes #2379

Merged
merged 1 commit into from Aug 2, 2021

Conversation

eugenelesnov
Copy link
Contributor

Should close #2363

As I understood, we can remove @CheckReturnValue from methods in org.mockito.Mockito after adding annotation on class

@eugenelesnov eugenelesnov marked this pull request as draft August 2, 2021 11:19
@TimvdLippe
Copy link
Contributor

It seems like we are going to need to update our own test suite to accommodate for these additional errors. Other than that, yes this solution LGTM!

@eugenelesnov
Copy link
Contributor Author

@TimvdLippe How do you think, how is it better to process errors in tests..Do I have to add local variables for situations like:

error: [CheckReturnValue] Ignored return value of method that is annotated with @CheckReturnValue
        anyObject();

Or should I add errorprone dependency to use @CanIgnoreReturnValue annotation?

@TimvdLippe
Copy link
Contributor

We can assign it to an ignored local variable, like I did in 182fd7f

@eugenelesnov eugenelesnov marked this pull request as ready for review August 2, 2021 21:10
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.

Yes this is great, thanks!

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.

Apply @CheckReturnValue more aggressively
2 participants