I have generated java protobuf class. This class has protobuf extensions also. Is it safe to modify different unrelated fields and extensions of the same protobuf builder in parallel?
message TopMessage {
FirstLeaf firstLeaf = 1;
SecondLeaf secondLeaf = 2;
final var topBuilder = TopMessage.newBuilder();
CompletableFuture.supplyAsync(() -> buildFirstLeaf(topBuilder));
CompletableFuture.supplyAsync(() -> buildSecondLeaf(topBuilder));
// wait for completion and return topBuilder.build();
TopMessageis a regular Java object once you've usedprotocto compile the Protobuf to Java. There are (un)marshaling methods but, as long as your Java object is correct before e.g. marshaling, there should be no issues paralellizing mutations.