diff options
author | Kristen Kozak <sebright@google.com> | 2017-07-25 09:21:15 -0700 |
---|---|---|
committer | Kristen Kozak <sebright@google.com> | 2017-07-25 09:21:15 -0700 |
commit | 35b8fef45a1d2f1babcd19a8cc239028208859fe (patch) | |
tree | 549e03fde73df5ac8883fee0692b03033fc36191 /api/src/main/java/io/opencensus/common | |
parent | 5ac2617a8e715cc318d5fc37a4a95899d967a3e5 (diff) | |
download | opencensus-java-35b8fef45a1d2f1babcd19a8cc239028208859fe.tar.gz |
Improve comments about suppressed "unchecked" warnings.
Diffstat (limited to 'api/src/main/java/io/opencensus/common')
-rw-r--r-- | api/src/main/java/io/opencensus/common/Functions.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/main/java/io/opencensus/common/Functions.java b/api/src/main/java/io/opencensus/common/Functions.java index dcc1dab5..67d1f9aa 100644 --- a/api/src/main/java/io/opencensus/common/Functions.java +++ b/api/src/main/java/io/opencensus/common/Functions.java @@ -75,7 +75,7 @@ public final class Functions { * IllegalArgumentException}. */ public static <T> Function<Object, T> throwIllegalArgumentException() { - // It is safe to cast a producer of Void to anything, because Void is always null. + // It is safe to cast this function to have any return type, since it never returns a result. @SuppressWarnings("unchecked") Function<Object, T> function = (Function<Object, T>) THROW_ILLEGAL_ARGUMENT_EXCEPTION; return function; @@ -88,7 +88,7 @@ public final class Functions { * AssertionError}. */ public static <T> Function<Object, T> throwAssertionError() { - // It is safe to cast a producer of Void to anything, because Void is always null. + // It is safe to cast this function to have any return type, since it never returns a result. @SuppressWarnings("unchecked") Function<Object, T> function = (Function<Object, T>) THROW_ASSERTION_ERROR; return function; |