api: remove nullable from StatusOr value methods#12338
Conversation
|
I'm a little bit worried that this is getting into specifics of one Nullable annotation vs another; I know they aren't all equivalent and there were limitations lifted with later annotations. Given that everything is |
|
I was trying to use this type in our code, with the result of unexpected warnings from IDE There are plenty of such warnings in this repo as well, e.g. grpc-java/xds/src/main/java/io/grpc/xds/ClusterResolverLoadBalancer.java Lines 118 to 119 in 1a7042a
|
|
All arguments/return types in gRPC should be Nullable from a tool's perspective. We don't have NonNull enabled at the package level. To my current understanding, if these changes here are causing changes in the IDE, then the IDE is broken. |
|
From a tool's perspective - default nullability is unknown. Why |
|
The suggested approach doesn't actually work with javax.annotation.Nullable: But the |
Correct, should be newer annotations, e.g. jspecify. |
ejona86
left a comment
There was a problem hiding this comment.
The reasoning is a bit different, but it is best to remove this at present.
It someone wants it nullable, that should be defined via the type parameter, e.g. `StatusOr<@nullable Foo> foo`
It someone wants it nullable, that should be defined via the type parameter, e.g. `StatusOr<@nullable Foo> foo`
It someone wants it nullable, that should be defined via the type parameter, e.g. `StatusOr<@nullable Foo> foo`
It someone wants it nullable, that should be defined via the type parameter, e.g.
StatusOr<@Nullable Foo> foo