Skip to content

Commit d5c6c7b

Browse files
TimNNcopybara-github
authored andcommitted
Large enums: Use _<n> suffix instead of just <n>
PiperOrigin-RevId: 858508634
1 parent f857a5e commit d5c6c7b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/google/protobuf/compiler/java/internal_helpers.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void GenerateLarge(io::Printer* printer, const EnumDescriptor* descriptor,
175175
interface_names.reserve(interface_count);
176176
for (int count = 0; count < interface_count; count++) {
177177
interface_names.push_back(
178-
absl::StrFormat("%s%d", descriptor->name(), count));
178+
absl::StrFormat("%s_%d", descriptor->name(), count));
179179
}
180180
printer->Emit(
181181
{{"interface_names", absl::StrJoin(interface_names, ", ")}},
@@ -225,7 +225,7 @@ void GenerateLarge(io::Printer* printer, const EnumDescriptor* descriptor,
225225
)");
226226
for (int count = 0; count < interface_count; count++) {
227227
printer->Emit({{"count", absl::StrCat(count)}}, R"(
228-
found = $classname$$count$.forNumber$count$(value);
228+
found = $classname$_$count$.forNumber$count$(value);
229229
if (found != null) {
230230
return found;
231231
}
@@ -242,7 +242,7 @@ void GenerateLarge(io::Printer* printer, const EnumDescriptor* descriptor,
242242
)");
243243
for (int count = 0; count < interface_count; count++) {
244244
printer->Emit({{"count", absl::StrCat(count)}}, R"(
245-
found = $classname$$count$.valueOf$count$(name);
245+
found = $classname$_$count$.valueOf$count$(name);
246246
if (found != null) {
247247
return found;
248248
}
@@ -264,7 +264,7 @@ void GenerateLarge(io::Printer* printer, const EnumDescriptor* descriptor,
264264

265265
for (int count = 0; count < interface_count; count++) {
266266
printer->Emit({{"count", count}}, R"(
267-
$classname$[] values$count$ = $classname$$count$.values$count$();
267+
$classname$[] values$count$ = $classname$_$count$.values$count$();
268268
System.arraycopy(values$count$, 0, values, ordinal, values$count$.length);
269269
ordinal += values$count$.length;
270270
)");
@@ -527,7 +527,7 @@ void GenerateLarge(io::Printer* printer, const EnumDescriptor* descriptor,
527527
{"deprecation", deprecation}},
528528
R"(
529529
$deprecation$
530-
public static final $classname$ $name$ = $classname$$canonical_interface_index$.$canonical_name$;
530+
public static final $classname$ $name$ = $classname$_$canonical_interface_index$.$canonical_name$;
531531
532532
)");
533533
} else {
@@ -624,7 +624,7 @@ void GenerateLarge(io::Printer* printer, const EnumDescriptor* descriptor,
624624
)");
625625
}}},
626626
R"(
627-
interface $classname$$count$ {
627+
interface $classname$_$count$ {
628628
629629
$enums$
630630

0 commit comments

Comments
 (0)