Add private constructor to Contexts and mark statusFromCancelled experimental. Fixes #1737 and #1736. (#1738)
diff --git a/core/src/main/java/io/grpc/Contexts.java b/core/src/main/java/io/grpc/Contexts.java
index 3b05470..48f730d 100644
--- a/core/src/main/java/io/grpc/Contexts.java
+++ b/core/src/main/java/io/grpc/Contexts.java
@@ -40,6 +40,9 @@
*/
public class Contexts {
+ private Contexts() {
+ }
+
/**
* Make the provided {@link Context} {@link Context#current()} for the creation of a listener
* to a received call and for all events received by that listener.
@@ -139,6 +142,7 @@
* Returns the {@link Status} of a cancelled context or {@code null} if the context
* is not cancelled.
*/
+ @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1737")
public static Status statusFromCancelled(Context context) {
Preconditions.checkNotNull(context, "context must not be null");
if (!context.isCancelled()) {