diff options
author | Carl Mastrangelo <notcarl@google.com> | 2018-08-06 11:44:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-06 11:44:52 -0700 |
commit | 67352081f8123d86903a719367a5865b5cc42a93 (patch) | |
tree | 40dfed1d99c1034c2be91ed776ed9c0744a240af /core | |
parent | 52a7b62a521120c1f095a1acfaf7216f48f73416 (diff) | |
download | grpc-grpc-java-67352081f8123d86903a719367a5865b5cc42a93.tar.gz |
core: revert warning about `Status.asException(null)`
There seem to be some users converting from StatusRuntimeException
to StatusException using the following paradigm:
sre.getStatus().toException(sre.getTrailers())
Since there isn't a viable alternative, revert the warning.
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/io/grpc/Status.java | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/core/src/main/java/io/grpc/Status.java b/core/src/main/java/io/grpc/Status.java index 8554f17c4..5e95c9884 100644 --- a/core/src/main/java/io/grpc/Status.java +++ b/core/src/main/java/io/grpc/Status.java @@ -29,7 +29,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.TreeMap; -import java.util.logging.Logger; import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; @@ -53,8 +52,6 @@ import javax.annotation.concurrent.Immutable; @Immutable public final class Status { - private static final Logger logger = Logger.getLogger(Status.class.getName()); - /** * The set of canonical status codes. If new codes are added over time they must choose * a numerical value that does not collide with any previously used value. @@ -525,10 +522,7 @@ public final class Status { * exception. */ @ExperimentalApi("https://github.com/grpc/grpc-java/issues/4683") - public StatusRuntimeException asRuntimeException(Metadata trailers) { - if (trailers == null) { - logger.warning("trailers cannot be null, this will become an error in gRPC 1.16"); - } + public StatusRuntimeException asRuntimeException(@Nullable Metadata trailers) { return new StatusRuntimeException(this, trailers); } @@ -544,10 +538,7 @@ public final class Status { * Same as {@link #asException()} but includes the provided trailers in the returned exception. */ @ExperimentalApi("https://github.com/grpc/grpc-java/issues/4683") - public StatusException asException(Metadata trailers) { - if (trailers == null) { - logger.warning("trailers cannot be null, this will become an error in gRPC 1.16"); - } + public StatusException asException(@Nullable Metadata trailers) { return new StatusException(this, trailers); } |