File protobuf-6ee16a9c60e734104aeb738503fe3f411c97bd88.patch of Package protobuf.29292

From 6ee16a9c60e734104aeb738503fe3f411c97bd88 Mon Sep 17 00:00:00 2001
From: ST-DDT <ST-DDT@gmx.de>
Date: Sat, 8 Jun 2019 22:48:09 +0200
Subject: [PATCH] Draft: Fix javadoc warnings in generated files

---
 src/google/protobuf/compiler/java/java_doc_comment.cc          |   44 ++++++++--
 src/google/protobuf/compiler/java/java_doc_comment.h           |    4 
 src/google/protobuf/compiler/java/java_enum.cc                 |    2 
 src/google/protobuf/compiler/java/java_enum_lite.cc            |    2 
 src/google/protobuf/compiler/java/java_message.cc              |    2 
 src/google/protobuf/compiler/java/java_message_field.cc        |   32 +++----
 src/google/protobuf/compiler/java/java_message_field_lite.cc   |    4 
 src/google/protobuf/compiler/java/java_primitive_field.cc      |   16 +--
 src/google/protobuf/compiler/java/java_primitive_field_lite.cc |   20 ++--
 src/google/protobuf/compiler/java/java_string_field.cc         |   24 ++---
 10 files changed, 97 insertions(+), 53 deletions(-)

--- a/src/google/protobuf/compiler/java/java_doc_comment.cc
+++ b/src/google/protobuf/compiler/java/java_doc_comment.cc
@@ -173,13 +173,10 @@ void WriteMessageDocComment(io::Printer*
 }
 
 void WriteFieldDocComment(io::Printer* printer, const FieldDescriptor* field) {
-  // In theory we should have slightly different comments for setters, getters,
-  // etc., but in practice everyone already knows the difference between these
-  // so it's redundant information.
-
   // We start the comment with the main body based on the comments from the
-  // .proto file (if present). We then end with the field declaration, e.g.:
+  // .proto file (if present). We then continue with the field declaration, e.g.:
   //   optional string foo = 5;
+  // And then we end with the javadoc tags if applicable.
   // If the field is a group, the debug string might end with {.
   printer->Print("/**\n");
   WriteDocCommentBody(printer, field);
@@ -188,6 +185,43 @@ void WriteFieldDocComment(io::Printer* p
   printer->Print(" */\n");
 }
 
+void WriteFieldGetterDocComment(io::Printer* printer, const FieldDescriptor* field) {
+  printer->Print("/**\n");
+  WriteDocCommentBody(printer, field);
+  printer->Print(" * <code>$def$</code>\n", "def", 
+                 EscapeJavadoc(FirstLineOf(field->DebugString())));
+  printer->Print(" * @return The $name$.\n", "name", field->camelcase_name());
+  printer->Print(" */\n");
+}
+
+void WriteFieldHaserDocComment(io::Printer* printer, const FieldDescriptor* field) {
+  printer->Print("/**\n");
+  WriteDocCommentBody(printer, field);
+  printer->Print(" * <code>$def$</code>\n", "def",
+                 EscapeJavadoc(FirstLineOf(field->DebugString())));
+  printer->Print(" * @return Whether the $name$ field is set.\n", "name", field->camelcase_name());
+  printer->Print(" */\n");
+}
+
+void WriteFieldSetterDocComment(io::Printer* printer, const FieldDescriptor* field) {
+  printer->Print("/**\n");
+  WriteDocCommentBody(printer, field);
+  printer->Print(" * <code>$def$</code>\n", "def",
+                 EscapeJavadoc(FirstLineOf(field->DebugString())));
+  printer->Print(" * @param value The $name$ to set.\n", "name", field->camelcase_name());
+  printer->Print(" * @return This builder for chaining.\n");
+  printer->Print(" */\n");
+}
+
+void WriteFieldClearerDocComment(io::Printer* printer, const FieldDescriptor* field) {
+  printer->Print("/**\n");
+  WriteDocCommentBody(printer, field);
+  printer->Print(" * <code>$def$</code>\n", "def",
+                 EscapeJavadoc(FirstLineOf(field->DebugString())));
+  printer->Print(" * @return This builder for chaining.\n");
+  printer->Print(" */\n");
+}
+
 void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enum_) {
   printer->Print("/**\n");
   WriteDocCommentBody(printer, enum_);
--- a/src/google/protobuf/compiler/java/java_doc_comment.h
+++ b/src/google/protobuf/compiler/java/java_doc_comment.h
@@ -54,6 +54,10 @@ namespace java {
 
 void WriteMessageDocComment(io::Printer* printer, const Descriptor* message);
 void WriteFieldDocComment(io::Printer* printer, const FieldDescriptor* field);
+void WriteFieldGetterDocComment(io::Printer* printer, const FieldDescriptor* field);
+void WriteFieldHaserDocComment(io::Printer* printer, const FieldDescriptor* field);
+void WriteFieldSetterDocComment(io::Printer* printer, const FieldDescriptor* field);
+void WriteFieldClearerDocComment(io::Printer* printer, const FieldDescriptor* field);
 void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enum_);
 void WriteEnumValueDocComment(io::Printer* printer,
                               const EnumValueDescriptor* value);
--- a/src/google/protobuf/compiler/java/java_enum.cc
+++ b/src/google/protobuf/compiler/java/java_enum.cc
@@ -175,6 +175,8 @@ void EnumGenerator::Generate(io::Printer
       "}\n"
       "\n"
       "/**\n"
+      " * @param value The number of the enum to look for.\n"
+      " * @return The enum associated with the given number.\n"
       " * @deprecated Use {@link #forNumber(int)} instead.\n"
       " */\n"
       "@java.lang.Deprecated\n"
--- a/src/google/protobuf/compiler/java/java_enum_lite.cc
+++ b/src/google/protobuf/compiler/java/java_enum_lite.cc
@@ -150,6 +150,8 @@ void EnumLiteGenerator::Generate(io::Pri
       "}\n"
       "\n"
       "/**\n"
+      " * @param value The number of the enum to look for.\n"
+      " * @return The enum associated with the given number.\n"
       " * @deprecated Use {@link #forNumber(int)} instead.\n"
       " */\n"
       "@java.lang.Deprecated\n"
--- a/src/google/protobuf/compiler/java/java_message.cc
+++ b/src/google/protobuf/compiler/java/java_message.cc
@@ -439,6 +439,8 @@ void ImmutableMessageGenerator::Generate
     printer->Print(
         vars,
         "/**\n"
+        " * @param value The number of the enum to look for.\n"
+        " * @return The enum associated with the given number.\n"
         " * @deprecated Use {@link #forNumber(int)} instead.\n"
         " */\n"
         "@java.lang.Deprecated\n"
--- a/src/google/protobuf/compiler/java/java_message_field.cc
+++ b/src/google/protobuf/compiler/java/java_message_field.cc
@@ -144,12 +144,12 @@ void ImmutableMessageFieldGenerator::Gen
   // interface so that builders can choose dynamically to either return a
   // message or a nested builder, so that asking for the interface doesn't
   // cause a message to ever be built.
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldHaserDocComment(printer, descriptor_);
   printer->Print(variables_, "$deprecation$boolean has$capitalized_name$();\n");
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n");
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(
       variables_,
       "$deprecation$$type$OrBuilder get$capitalized_name$OrBuilder();\n");
@@ -161,14 +161,14 @@ void ImmutableMessageFieldGenerator::Gen
   PrintExtraFieldInfo(variables_, printer);
 
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n"
         "  return $get_has_field_bit_message$;\n"
         "}\n");
     printer->Annotate("{", "}", descriptor_);
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldGetterDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n"
@@ -185,14 +185,14 @@ void ImmutableMessageFieldGenerator::Gen
         "}\n");
     printer->Annotate("{", "}", descriptor_);
   } else {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n"
         "  return $name$_ != null;\n"
         "}\n");
     printer->Annotate("{", "}", descriptor_);
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldGetterDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n"
@@ -261,7 +261,7 @@ void ImmutableMessageFieldGenerator::Gen
   // field of type "Field" called "Field".
 
   // boolean hasField()
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldHaserDocComment(printer, descriptor_);
   if (support_field_presence) {
     printer->Print(
         variables_,
@@ -279,14 +279,14 @@ void ImmutableMessageFieldGenerator::Gen
   }
 
   // Field getField()
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   PrintNestedBuilderFunction(
       printer, "$deprecation$public $type$ ${$get$capitalized_name$$}$()",
       "return $name$_ == null ? $type$.getDefaultInstance() : $name$_;\n",
       "return $name$Builder_.getMessage();\n", NULL);
 
   // Field.Builder setField(Field value)
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldSetterDocComment(printer, descriptor_);
   PrintNestedBuilderFunction(
       printer,
       "$deprecation$public Builder ${$set$capitalized_name$$}$($type$ value)",
@@ -303,7 +303,7 @@ void ImmutableMessageFieldGenerator::Gen
       "return this;\n");
 
   // Field.Builder setField(Field.Builder builderForValue)
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldSetterDocComment(printer, descriptor_);
   PrintNestedBuilderFunction(
       printer,
       "$deprecation$public Builder ${$set$capitalized_name$$}$(\n"
@@ -347,7 +347,7 @@ void ImmutableMessageFieldGenerator::Gen
       "return this;\n");
 
   // Field.Builder clearField()
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldClearerDocComment(printer, descriptor_);
   PrintNestedBuilderFunction(
       printer, "$deprecation$public Builder ${$clear$capitalized_name$$}$()",
 
@@ -535,13 +535,13 @@ ImmutableMessageOneofFieldGenerator::~Im
 void ImmutableMessageOneofFieldGenerator::GenerateMembers(
     io::Printer* printer) const {
   PrintExtraFieldInfo(variables_, printer);
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldHaserDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n"
                  "  return $has_oneof_case_message$;\n"
                  "}\n");
   printer->Annotate("{", "}", descriptor_);
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n"
                  "  if ($has_oneof_case_message$) {\n"
@@ -579,7 +579,7 @@ void ImmutableMessageOneofFieldGenerator
   // field of type "Field" called "Field".
 
   // boolean hasField()
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldHaserDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n"
                  "  return $has_oneof_case_message$;\n"
@@ -587,7 +587,7 @@ void ImmutableMessageOneofFieldGenerator
   printer->Annotate("{", "}", descriptor_);
 
   // Field getField()
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   PrintNestedBuilderFunction(
       printer, "$deprecation$public $type$ ${$get$capitalized_name$$}$()",
 
--- a/src/google/protobuf/compiler/java/java_message_field_lite.cc
+++ b/src/google/protobuf/compiler/java/java_message_field_lite.cc
@@ -121,9 +121,9 @@ int ImmutableMessageFieldLiteGenerator::
 
 void ImmutableMessageFieldLiteGenerator::GenerateInterfaceMembers(
     io::Printer* printer) const {
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldHaserDocComment(printer, descriptor_);
   printer->Print(variables_, "$deprecation$boolean has$capitalized_name$();\n");
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n");
 }
 
--- a/src/google/protobuf/compiler/java/java_primitive_field.cc
+++ b/src/google/protobuf/compiler/java/java_primitive_field.cc
@@ -219,7 +219,7 @@ void ImmutablePrimitiveFieldGenerator::G
   printer->Print(variables_, "private $field_type$ $name$_;\n");
   PrintExtraFieldInfo(variables_, printer);
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n"
@@ -228,7 +228,7 @@ void ImmutablePrimitiveFieldGenerator::G
     printer->Annotate("{", "}", descriptor_);
   }
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n"
                  "  return $name$_;\n"
@@ -241,7 +241,7 @@ void ImmutablePrimitiveFieldGenerator::G
   printer->Print(variables_, "private $field_type$ $name$_ $default_init$;\n");
 
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n"
@@ -250,7 +250,7 @@ void ImmutablePrimitiveFieldGenerator::G
     printer->Annotate("{", "}", descriptor_);
   }
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n"
                  "  return $name$_;\n"
@@ -492,7 +492,7 @@ void ImmutablePrimitiveOneofFieldGenerat
     io::Printer* printer) const {
   PrintExtraFieldInfo(variables_, printer);
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n"
@@ -501,7 +501,7 @@ void ImmutablePrimitiveOneofFieldGenerat
     printer->Annotate("{", "}", descriptor_);
   }
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n"
                  "  if ($has_oneof_case_message$) {\n"
@@ -515,7 +515,7 @@ void ImmutablePrimitiveOneofFieldGenerat
 void ImmutablePrimitiveOneofFieldGenerator::GenerateBuilderMembers(
     io::Printer* printer) const {
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n"
@@ -524,7 +524,7 @@ void ImmutablePrimitiveOneofFieldGenerat
     printer->Annotate("{", "}", descriptor_);
   }
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n"
                  "  if ($has_oneof_case_message$) {\n"
--- a/src/google/protobuf/compiler/java/java_primitive_field_lite.cc
+++ b/src/google/protobuf/compiler/java/java_primitive_field_lite.cc
@@ -198,11 +198,11 @@ int ImmutablePrimitiveFieldLiteGenerator
 void ImmutablePrimitiveFieldLiteGenerator::GenerateInterfaceMembers(
     io::Printer* printer) const {
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(variables_,
                    "$deprecation$boolean has$capitalized_name$();\n");
   }
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n");
 }
 
@@ -218,7 +218,7 @@ void ImmutablePrimitiveFieldLiteGenerato
   printer->Print(variables_, "private $field_type$ $name$_;\n");
   PrintExtraFieldInfo(variables_, printer);
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "@java.lang.Override\n"
@@ -228,7 +228,7 @@ void ImmutablePrimitiveFieldLiteGenerato
     printer->Annotate("{", "}", descriptor_);
   }
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "@java.lang.Override\n"
                  "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n"
@@ -264,7 +264,7 @@ void ImmutablePrimitiveFieldLiteGenerato
 void ImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers(
     io::Printer* printer) const {
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "@java.lang.Override\n"
@@ -274,7 +274,7 @@ void ImmutablePrimitiveFieldLiteGenerato
     printer->Annotate("{", "}", descriptor_);
   }
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "@java.lang.Override\n"
                  "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n"
@@ -347,7 +347,7 @@ void ImmutablePrimitiveOneofFieldLiteGen
     io::Printer* printer) const {
   PrintExtraFieldInfo(variables_, printer);
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "@java.lang.Override\n"
@@ -357,7 +357,7 @@ void ImmutablePrimitiveOneofFieldLiteGen
     printer->Annotate("{", "}", descriptor_);
   }
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "@java.lang.Override\n"
                  "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n"
@@ -397,7 +397,7 @@ void ImmutablePrimitiveOneofFieldLiteGen
 void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateBuilderMembers(
     io::Printer* printer) const {
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "@java.lang.Override\n"
@@ -407,7 +407,7 @@ void ImmutablePrimitiveOneofFieldLiteGen
     printer->Annotate("{", "}", descriptor_);
   }
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "@java.lang.Override\n"
                  "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n"
--- a/src/google/protobuf/compiler/java/java_string_field.cc
+++ b/src/google/protobuf/compiler/java/java_string_field.cc
@@ -190,14 +190,14 @@ int ImmutableStringFieldGenerator::GetNu
 void ImmutableStringFieldGenerator::GenerateInterfaceMembers(
     io::Printer* printer) const {
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(variables_,
                    "$deprecation$boolean has$capitalized_name$();\n");
   }
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "$deprecation$java.lang.String get$capitalized_name$();\n");
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "$deprecation$com.google.protobuf.ByteString\n"
                  "    get$capitalized_name$Bytes();\n");
@@ -209,7 +209,7 @@ void ImmutableStringFieldGenerator::Gene
   PrintExtraFieldInfo(variables_, printer);
 
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n"
@@ -218,7 +218,7 @@ void ImmutableStringFieldGenerator::Gene
     printer->Annotate("{", "}", descriptor_);
   }
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(
       variables_,
       "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n"
@@ -242,7 +242,7 @@ void ImmutableStringFieldGenerator::Gene
                  "    return s;\n"
                  "  }\n"
                  "}\n");
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "$deprecation$public com.google.protobuf.ByteString\n"
                  "    ${$get$capitalized_name$Bytes$}$() {\n"
@@ -265,7 +265,7 @@ void ImmutableStringFieldGenerator::Gene
   printer->Print(variables_,
                  "private java.lang.Object $name$_ $default_init$;\n");
   if (SupportFieldPresence(descriptor_->file())) {
-    WriteFieldDocComment(printer, descriptor_);
+    WriteFieldHaserDocComment(printer, descriptor_);
     printer->Print(
         variables_,
         "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n"
@@ -274,7 +274,7 @@ void ImmutableStringFieldGenerator::Gene
     printer->Annotate("{", "}", descriptor_);
   }
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(
       variables_,
       "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n"
@@ -299,7 +299,7 @@ void ImmutableStringFieldGenerator::Gene
                  "  }\n"
                  "}\n");
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldGetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "$deprecation$public com.google.protobuf.ByteString\n"
                  "    ${$get$capitalized_name$Bytes$}$() {\n"
@@ -316,7 +316,7 @@ void ImmutableStringFieldGenerator::Gene
                  "}\n");
   printer->Annotate("{", "}", descriptor_);
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldSetterDocComment(printer, descriptor_);
   printer->Print(variables_,
                  "$deprecation$public Builder ${$set$capitalized_name$$}$(\n"
                  "    java.lang.String value) {\n"
@@ -327,7 +327,7 @@ void ImmutableStringFieldGenerator::Gene
                  "  return this;\n"
                  "}\n");
   printer->Annotate("{", "}", descriptor_);
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldClearerDocComment(printer, descriptor_);
   printer->Print(
       variables_,
       "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n"
@@ -342,7 +342,7 @@ void ImmutableStringFieldGenerator::Gene
                  "  return this;\n"
                  "}\n");
 
-  WriteFieldDocComment(printer, descriptor_);
+  WriteFieldSetterDocComment(printer, descriptor_);
   printer->Print(
       variables_,
       "$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n"
openSUSE Build Service is sponsored by