Nano proto and Proto3 do no include fields that have their default values in the wire format.

Avoid using hasxxxx

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82743695
This commit is contained in:
rocking 2014-12-23 14:11:50 -08:00 committed by Eric Anderson
parent c0f41920bd
commit ee86ee41a0
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ public class TestServiceImpl implements TestServiceGrpc.TestService {
public void unaryCall(SimpleRequest req, public void unaryCall(SimpleRequest req,
StreamObserver<SimpleResponse> responseObserver) { StreamObserver<SimpleResponse> responseObserver) {
SimpleResponse.Builder responseBuilder = SimpleResponse.newBuilder(); SimpleResponse.Builder responseBuilder = SimpleResponse.newBuilder();
if (req.hasResponseType() && req.hasResponseSize()) { if (req.getResponseSize() != 0) {
boolean compressable = compressableResponse(req.getResponseType()); boolean compressable = compressableResponse(req.getResponseType());
ByteString dataBuffer = compressable ? compressableBuffer : uncompressableBuffer; ByteString dataBuffer = compressable ? compressableBuffer : uncompressableBuffer;
// For consistency with the c++ TestServiceImpl, use a random offset for unary calls. // For consistency with the c++ TestServiceImpl, use a random offset for unary calls.