Internal change

PiperOrigin-RevId: 602736730
pull/15636/head
Luke Sandberg 10 months ago committed by Copybara-Service
parent 49c83ab799
commit 531d4372f4
  1. 9
      java/core/src/main/java/com/google/protobuf/GeneratedMessage.java

@ -33,6 +33,7 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
/**
@ -135,7 +136,9 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial
*/
private Map<FieldDescriptor, Object> getAllFieldsMutable(boolean getBytesForString) {
final TreeMap<FieldDescriptor, Object> result = new TreeMap<>();
final Descriptor descriptor = internalGetFieldAccessorTable().descriptor;
final FieldAccessorTable fieldAccessorTable = internalGetFieldAccessorTable();
final Descriptor descriptor = fieldAccessorTable.descriptor;
final List<FieldDescriptor> fields = descriptor.getFields();
for (int i = 0; i < fields.size(); i++) {
@ -561,7 +564,8 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial
/** Internal helper which returns a mutable map. */
private Map<FieldDescriptor, Object> getAllFieldsMutable() {
final TreeMap<FieldDescriptor, Object> result = new TreeMap<>();
final Descriptor descriptor = internalGetFieldAccessorTable().descriptor;
final FieldAccessorTable fieldAccessorTable = internalGetFieldAccessorTable();
final Descriptor descriptor = fieldAccessorTable.descriptor;
final List<FieldDescriptor> fields = descriptor.getFields();
for (int i = 0; i < fields.size(); i++) {
@ -2057,7 +2061,6 @@ public abstract class GeneratedMessage extends AbstractMessage implements Serial
oneofs[i] = new SyntheticOneofAccessor(descriptor, i);
}
}
initialized = true;
camelCaseNames = null;
return this;

Loading…
Cancel
Save