Skip to content

Commit

Permalink
services: make BinlogHelper compatible with lite runtime
Browse files Browse the repository at this point in the history
This commit makes a small change to BinlogHelper to make it compatible with the Protobuf Java Lite runtime.

In the Lite runtime, the `addXBuilder` for repeated fields is not available. Instead, the `addX` method must be used with a manually-constructed Builder.
  • Loading branch information
elipsitz authored and ejona86 committed Dec 7, 2023
1 parent 55a9c01 commit 3e3ba56
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import io.grpc.binarylog.v1.GrpcLogEntry;
import io.grpc.binarylog.v1.GrpcLogEntry.EventType;
import io.grpc.binarylog.v1.Message;
import io.grpc.binarylog.v1.MetadataEntry;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
Expand Down Expand Up @@ -851,9 +852,8 @@ static MaybeTruncated<io.grpc.binarylog.v1.Metadata.Builder> createMetadataProto
truncated = true;
continue;
}
metaBuilder.addEntryBuilder()
.setKey(key)
.setValue(ByteString.copyFrom(value));
metaBuilder.addEntry(
MetadataEntry.newBuilder().setKey(key).setValue(ByteString.copyFrom(value)));
if (!forceInclude) {
// force included keys do not count towards the size limit
curBytes = bytesAfterAdd;
Expand Down

0 comments on commit 3e3ba56

Please sign in to comment.