From 9f182da9a4fabdabde43b96bcccd9a88a16315d3 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Wed, 5 Jun 2024 14:26:46 -0700 Subject: [PATCH] Internal change PiperOrigin-RevId: 640649818 --- java/core/src/main/java/com/google/protobuf/TextFormat.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/core/src/main/java/com/google/protobuf/TextFormat.java b/java/core/src/main/java/com/google/protobuf/TextFormat.java index eb484f03200c6..dfeeea418a4b3 100644 --- a/java/core/src/main/java/com/google/protobuf/TextFormat.java +++ b/java/core/src/main/java/com/google/protobuf/TextFormat.java @@ -1537,6 +1537,7 @@ public enum SingularOverwritePolicy { private final SingularOverwritePolicy singularOverwritePolicy; private TextFormatParseInfoTree.Builder parseInfoTreeBuilder; private final int recursionLimit; + private Descriptor rootType; private Parser( TypeRegistry typeRegistry, @@ -1553,6 +1554,7 @@ private Parser( this.singularOverwritePolicy = singularOverwritePolicy; this.parseInfoTreeBuilder = parseInfoTreeBuilder; this.recursionLimit = recursionLimit; + this.rootType = null; } /** Returns a new instance of {@link Builder}. */ @@ -1754,6 +1756,7 @@ public void merge( throws ParseException { final Tokenizer tokenizer = new Tokenizer(input); MessageReflection.BuilderAdapter target = new MessageReflection.BuilderAdapter(builder); + rootType = target.getDescriptorForType(); List unknownFields = new ArrayList(); while (!tokenizer.atEnd()) {