mirror of https://github.com/grpc/grpc-java.git
Minor readability changes
Improved some consistency. writeHeaders was the only non-final implementation method of ServerStream, even though it is really no different than the others.
This commit is contained in:
parent
9a5c733ce9
commit
26d77ecd2e
|
|
@ -44,6 +44,8 @@ import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract base class for {@link ServerStream} implementations.
|
* Abstract base class for {@link ServerStream} implementations.
|
||||||
|
*
|
||||||
|
* @param <IdT> the type of the stream identifier
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractServerStream<IdT> extends AbstractStream<IdT>
|
public abstract class AbstractServerStream<IdT> extends AbstractStream<IdT>
|
||||||
implements ServerStream {
|
implements ServerStream {
|
||||||
|
|
@ -89,7 +91,7 @@ public abstract class AbstractServerStream<IdT> extends AbstractStream<IdT>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeHeaders(Metadata.Headers headers) {
|
public final void writeHeaders(Metadata.Headers headers) {
|
||||||
Preconditions.checkNotNull(headers, "headers");
|
Preconditions.checkNotNull(headers, "headers");
|
||||||
outboundPhase(Phase.HEADERS);
|
outboundPhase(Phase.HEADERS);
|
||||||
headersSent = true;
|
headersSent = true;
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,11 @@ class NettyServerStream extends AbstractServerStream<Integer> {
|
||||||
private final Channel channel;
|
private final Channel channel;
|
||||||
private final NettyServerHandler handler;
|
private final NettyServerHandler handler;
|
||||||
private final Http2Stream http2Stream;
|
private final Http2Stream http2Stream;
|
||||||
private WriteQueue writeQueue;
|
private final WriteQueue writeQueue;
|
||||||
|
|
||||||
NettyServerStream(Channel channel, Http2Stream http2Stream, NettyServerHandler handler) {
|
NettyServerStream(Channel channel, Http2Stream http2Stream, NettyServerHandler handler) {
|
||||||
super(new NettyWritableBufferAllocator(channel.alloc()));
|
super(new NettyWritableBufferAllocator(channel.alloc()));
|
||||||
writeQueue = handler.getWriteQueue();
|
this.writeQueue = handler.getWriteQueue();
|
||||||
this.channel = checkNotNull(channel, "channel");
|
this.channel = checkNotNull(channel, "channel");
|
||||||
this.http2Stream = checkNotNull(http2Stream, "http2Stream");
|
this.http2Stream = checkNotNull(http2Stream, "http2Stream");
|
||||||
this.handler = checkNotNull(handler, "handler");
|
this.handler = checkNotNull(handler, "handler");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue