Skip to content

Commit aec4023

Browse files
zhangskzcopybara-github
authored andcommitted
Clean up java generated code to always mark private descriptor variable as final.
This is already a private variable and should not break compatibility. PiperOrigin-RevId: 834882104
1 parent 42418ee commit aec4023

File tree

1 file changed

+2
-4
lines changed
  • src/google/protobuf/compiler/java

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,11 +471,9 @@ void FileGenerator::GenerateDescriptorInitializationCodeForImmutable(
471471
" getDescriptor() {\n"
472472
" return descriptor;\n"
473473
"}\n"
474-
"private static $final$ com.google.protobuf.Descriptors.FileDescriptor\n"
474+
"private static final com.google.protobuf.Descriptors.FileDescriptor\n"
475475
" descriptor;\n"
476-
"static {\n",
477-
// TODO: Mark this as final.
478-
"final", google::protobuf::internal::IsOss() ? "" : "final");
476+
"static {\n");
479477
printer->Indent();
480478

481479
if (google::protobuf::internal::IsOss()) {

0 commit comments

Comments
 (0)