Skip to content

Commit 187f986

Browse files
sanjaypujarelarry-safran
authored andcommitted
stub: remove 2 deprecated methods from MetadataUtils (grpc#10443)
1 parent edefee4 commit 187f986

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

stub/src/main/java/io/grpc/stub/MetadataUtils.java

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818

1919
import static com.google.common.base.Preconditions.checkNotNull;
2020

21-
import com.google.errorprone.annotations.InlineMe;
2221
import io.grpc.CallOptions;
2322
import io.grpc.Channel;
2423
import io.grpc.ClientCall;
2524
import io.grpc.ClientInterceptor;
26-
import io.grpc.ExperimentalApi;
2725
import io.grpc.ForwardingClientCall.SimpleForwardingClientCall;
2826
import io.grpc.ForwardingClientCallListener.SimpleForwardingClientCallListener;
2927
import io.grpc.Metadata;
@@ -38,24 +36,6 @@ public final class MetadataUtils {
3836
// Prevent instantiation
3937
private MetadataUtils() {}
4038

41-
/**
42-
* Attaches a set of request headers to a stub.
43-
*
44-
* @param stub to bind the headers to.
45-
* @param extraHeaders the headers to be passed by each call on the returned stub.
46-
* @return an implementation of the stub with {@code extraHeaders} bound to each call.
47-
* @deprecated Use {@code stub.withInterceptors(newAttachHeadersInterceptor(...))} instead.
48-
*/
49-
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1789")
50-
@Deprecated
51-
@InlineMe(
52-
replacement =
53-
"stub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(extraHeaders))",
54-
imports = "io.grpc.stub.MetadataUtils")
55-
public static <T extends AbstractStub<T>> T attachHeaders(T stub, Metadata extraHeaders) {
56-
return stub.withInterceptors(newAttachHeadersInterceptor(extraHeaders));
57-
}
58-
5939
/**
6040
* Returns a client interceptor that attaches a set of headers to requests.
6141
*
@@ -97,31 +77,6 @@ public void start(Listener<RespT> responseListener, Metadata headers) {
9777
}
9878
}
9979

100-
/**
101-
* Captures the last received metadata for a stub. Useful for testing
102-
*
103-
* @param stub to capture for
104-
* @param headersCapture to record the last received headers
105-
* @param trailersCapture to record the last received trailers
106-
* @return an implementation of the stub that allows to access the last received call's
107-
* headers and trailers via {@code headersCapture} and {@code trailersCapture}.
108-
* @deprecated Use {@code stub.withInterceptors(newCaptureMetadataInterceptor())} instead.
109-
*/
110-
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1789")
111-
@Deprecated
112-
@InlineMe(
113-
replacement =
114-
"stub.withInterceptors(MetadataUtils.newCaptureMetadataInterceptor(headersCapture,"
115-
+ " trailersCapture))",
116-
imports = "io.grpc.stub.MetadataUtils")
117-
public static <T extends AbstractStub<T>> T captureMetadata(
118-
T stub,
119-
AtomicReference<Metadata> headersCapture,
120-
AtomicReference<Metadata> trailersCapture) {
121-
return stub.withInterceptors(
122-
newCaptureMetadataInterceptor(headersCapture, trailersCapture));
123-
}
124-
12580
/**
12681
* Captures the last received metadata on a channel. Useful for testing.
12782
*

0 commit comments

Comments
 (0)