diff options
author | sebright <sebright@google.com> | 2018-08-01 17:54:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-01 17:54:30 -0700 |
commit | daa5d097e18211ad95a0e5bc63697e615db91902 (patch) | |
tree | 6022a2f76f3d883569eff2ca007fdcedd32cc879 /checker-framework | |
parent | 87f199dba62baf5003c039d000c3a576859ebb93 (diff) | |
download | opencensus-java-daa5d097e18211ad95a0e5bc63697e615db91902.tar.gz |
Add Checker Framework stub file for gRPC Context.Key. (#1357)
The stub file adds Nullable annotations to indicate that Context.Key.get can
return null when the key has no default or the key has a nullable value type.
Diffstat (limited to 'checker-framework')
-rw-r--r-- | checker-framework/stubs/grpc.astub | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/checker-framework/stubs/grpc.astub b/checker-framework/stubs/grpc.astub new file mode 100644 index 00000000..f8581eba --- /dev/null +++ b/checker-framework/stubs/grpc.astub @@ -0,0 +1,12 @@ +package io.grpc; + +import org.checkerframework.checker.nullness.qual.Nullable; + +class Context { + static <T> Key<@Nullable T> key(String name); + static <T> Key<T> keyWithDefault(String name, T defaultValue); + class Key<T> { + T get(Context context); + T get(); + } +} |