@@ -3865,9 +3865,9 @@ class DescriptorBuilder {
3865
3865
const ServiceDescriptor* parent, MethodDescriptor* result,
3866
3866
internal::FlatAllocator& alloc);
3867
3867
3868
- void CheckFieldJSONNameUniqueness (const DescriptorProto& proto,
3868
+ void CheckFieldJsonNameUniqueness (const DescriptorProto& proto,
3869
3869
const Descriptor* result);
3870
- void CheckFieldJSONNameUniqueness (std::string message_name,
3870
+ void CheckFieldJsonNameUniqueness (std::string message_name,
3871
3871
const DescriptorProto& message,
3872
3872
bool is_proto2, bool use_custom_names);
3873
3873
void CheckEnumValueUniqueness (const EnumDescriptorProto& proto,
@@ -5428,7 +5428,7 @@ void DescriptorBuilder::BuildMessage(const DescriptorProto& proto,
5428
5428
}
5429
5429
}
5430
5430
5431
- CheckFieldJSONNameUniqueness (proto, result);
5431
+ CheckFieldJsonNameUniqueness (proto, result);
5432
5432
5433
5433
// Check that fields aren't using reserved names or numbers and that they
5434
5434
// aren't using extension numbers.
@@ -5496,7 +5496,7 @@ void DescriptorBuilder::BuildMessage(const DescriptorProto& proto,
5496
5496
}
5497
5497
}
5498
5498
5499
- std::string GetJSONName (const FieldDescriptorProto& field, bool use_custom, bool * was_custom) {
5499
+ std::string GetJsonName (const FieldDescriptorProto& field, bool use_custom, bool * was_custom) {
5500
5500
if (use_custom && field.has_json_name ()) {
5501
5501
*was_custom = true ;
5502
5502
return field.json_name ();
@@ -5505,28 +5505,28 @@ std::string GetJSONName(const FieldDescriptorProto& field, bool use_custom, bool
5505
5505
return ToJsonName (field.name ());
5506
5506
}
5507
5507
5508
- void DescriptorBuilder::CheckFieldJSONNameUniqueness (
5508
+ void DescriptorBuilder::CheckFieldJsonNameUniqueness (
5509
5509
const DescriptorProto& proto, const Descriptor* result) {
5510
5510
bool is_proto2 = result->file ()->syntax () == FileDescriptor::SYNTAX_PROTO2;
5511
5511
std::string message_name = result->full_name ();
5512
5512
// two passes: one looking only at default JSON names, and one that considers custom JSON names
5513
- CheckFieldJSONNameUniqueness (message_name, proto, is_proto2, false );
5514
- CheckFieldJSONNameUniqueness (message_name, proto, is_proto2, true );
5513
+ CheckFieldJsonNameUniqueness (message_name, proto, is_proto2, false );
5514
+ CheckFieldJsonNameUniqueness (message_name, proto, is_proto2, true );
5515
5515
}
5516
5516
5517
- struct JSONNameDetails {
5517
+ struct JsonNameDetails {
5518
5518
const FieldDescriptorProto* field;
5519
5519
std::string orig_name;
5520
5520
bool is_custom;
5521
5521
};
5522
5522
5523
- void DescriptorBuilder::CheckFieldJSONNameUniqueness (
5523
+ void DescriptorBuilder::CheckFieldJsonNameUniqueness (
5524
5524
std::string message_name,const DescriptorProto& message, bool is_proto2, bool use_custom_names) {
5525
5525
5526
- std::map<std::string, struct JSONNameDetails > name_to_field;
5526
+ std::map<std::string, JsonNameDetails > name_to_field;
5527
5527
for (int i = 0 ; i < message.field_size (); ++i) {
5528
5528
bool is_custom;
5529
- std::string name = GetJSONName (message.field (i), use_custom_names, &is_custom);
5529
+ std::string name = GetJsonName (message.field (i), use_custom_names, &is_custom);
5530
5530
std::string lowercase_name = absl::AsciiStrToLower (name);
5531
5531
auto existing = name_to_field.find (lowercase_name);
5532
5532
if (existing != name_to_field.end ()) {
@@ -5559,7 +5559,7 @@ void DescriptorBuilder::CheckFieldJSONNameUniqueness(
5559
5559
DescriptorPool::ErrorCollector::NAME, error_message);
5560
5560
}
5561
5561
} else {
5562
- struct JSONNameDetails details = { &message.field (i), name, is_custom };
5562
+ JsonNameDetails details = { &message.field (i), name, is_custom };
5563
5563
name_to_field[lowercase_name] = details;
5564
5564
}
5565
5565
}
0 commit comments