Skip to content

Migrate from JSR305's javax.annotation.CheckReturnValue to ErrorProne's com.google.errorprone.annotations.CheckReturnValue #8687

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

Closed
dapengzhang0 opened this issue Nov 11, 2021 · 4 comments · Fixed by #11811
Milestone

Comments

@dapengzhang0
Copy link
Member

Initiated by cl/408694635

@ejona86 ejona86 added this to the Next milestone Nov 11, 2021
@kluever
Copy link
Contributor

kluever commented Nov 11, 2021

See also cl/408694507

@RamAnvesh
Copy link

Hi Any update on this?

Summary of the issue:
When using grpc-java in a modularized application, I was facing issues with javax.annotation.Generated annotation. The fix for this suggested was to add javax.annotation-api as a dependency.
But after doing this, the javax.annotation.CheckReturnValue is not being read from the jsr-305 jar.

@vietj
Copy link

vietj commented Jul 1, 2024

there are actually a bunch of annotations that are used in the codebase that rely on the javax.annotation package:

  • Nullable
  • Immutable
  • ThreadSafe
  • etc...

such annotations prevent using io.grpc as JPMS module, e.g.

[ERROR] module io.grpc.util reads package javax.annotation from both java.annotation and jsr305
[ERROR] module io.grpc.stub reads package javax.annotation from both java.annotation and jsr305

I am willing contributing the migration to error prone (which does not seem trivial), is that a contribution that would be accepted by the grpc-java project ?

@vietj
Copy link

vietj commented Jul 1, 2024

ping @ejona86

ejona86 added a commit to ejona86/grpc-java that referenced this issue Jan 9, 2025
We should avoid jsr305 and error prone's has the same semantics.

Fixes grpc#8687
@ejona86 ejona86 closed this as completed in 7b5d069 Jan 9, 2025
@ejona86 ejona86 modified the milestones: Next, 1.71 Jan 9, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants