Let MessageLiteCodec handle UnknownFieldSet.
package com.google.devtools.build.lib.skyframe.serialization;
+import com.google.common.collect.ImmutableList;
import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistryLite;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.MessageLite;
+import com.google.protobuf.UnknownFieldSet;
import java.io.IOException;
import java.util.function.Supplier;
@@ -65,4 +67,11 @@ public class MessageLiteCodec implements ObjectCodec<MessageLite> {
codedIn.enableAliasing(true);
}
}
+
+ private static class MessageLiteCodecRegisterer implements CodecRegisterer<MessageLiteCodec> {
+ @Override
+ public ImmutableList<MessageLiteCodec> getCodecsToRegister() {
+ return ImmutableList.of(new MessageLiteCodec(UnknownFieldSet::newBuilder));
+ }
+ }
}
