From 6b9cd6d6ed2bbfea41b8605e028ad9aafffd5737 Mon Sep 17 00:00:00 2001 From: Jongho Jeon Date: Thu, 14 May 2020 05:35:17 +0900 Subject: [PATCH] grpc-context: name Context#key(name) parameter more clearly Motivated by #7024 --- context/src/main/java/io/grpc/Context.java | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/context/src/main/java/io/grpc/Context.java b/context/src/main/java/io/grpc/Context.java index 5a4a7bf444..da540215be 100644 --- a/context/src/main/java/io/grpc/Context.java +++ b/context/src/main/java/io/grpc/Context.java @@ -153,19 +153,25 @@ public class Context { } /** - * Create a {@link Key} with the given debug name. Multiple different keys may have the same name; - * the name is intended for debugging purposes and does not impact behavior. + * Create a {@link Key} with the given debug name. + * + * @param debugString a name intended for debugging purposes and does not impact behavior. + * Multiple different keys may have the same debugString. + * The value should be not null. */ - public static Key key(String name) { - return new Key<>(name); + public static Key key(String debugString) { + return new Key<>(debugString); } /** - * Create a {@link Key} with the given debug name and default value. Multiple different keys may - * have the same name; the name is intended for debugging purposes and does not impact behavior. + * Create a {@link Key} with the given debug name and default value. + * + * @param debugString a name intended for debugging purposes and does not impact behavior. + * Multiple different keys may have the same debugString. + * The value should be not null. */ - public static Key keyWithDefault(String name, T defaultValue) { - return new Key<>(name, defaultValue); + public static Key keyWithDefault(String debugString, T defaultValue) { + return new Key<>(debugString, defaultValue); } /**