Consider adding @Nullable / @Nonnull annotations to generated services
See original GitHub issuePlease answer these questions before submitting your issue.
What version of gRPC are you using?
1.13.2
What did you expect to see?
It would be very helpful for those of us implementing *ImplBase classes in Kotlin if the parameters of generated rpc
methods were annotated with @javax.annotation.Nonnull
as it gives tooling a hint that the signature of an override
should use the non-nullable form of the parameter types.
Minor, but would make implementing services in Kotlin that bit more seamless.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:16 (12 by maintainers)
Top Results From Across the Web
@Nullable and @NotNull | IntelliJ IDEA Documentation
@Nullable and @NotNull annotations let you check nullability of a variable, parameter, or return value. They help you control contracts ...
Read more >java - How to use @Nullable and @Nonnull annotations more ...
1. Propagating the @Nonnull to have indirectPathToA(@Nonnull Integer y) is IMHO a bad practice: you will need to mainain the propagation on the...
Read more >@NoArgsConstructor, @RequiredArgsConstructor ...
For those fields marked with @NonNull , an explicit null check is also generated. The constructor will throw a NullPointerException if any of...
Read more >Update your codebase to use nullable reference types
The global nullable context does not apply for generated code files. Under either strategy, the nullable context is disabled for any source file...
Read more >Nullable & NonNull - Medium
If any parameter is mark as @NonNull, we can stripe the null check with confidant. On the other hand, if the parameter is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would like to see these annotations included for kotlin, I’m writing server side kotlin code using grpc and it would make my life a lot better if they were everywhere in the library, generated code and non-generated code. Bringing along another dep is inconsequential compared to the code elegance that would be gained
And javax.annotation:javax.annotation-api (including
javax.annotation.Generated
) and jsr305 (@Nullable
) are different dependencies.