Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP2:Update
protobuf.36265
protobuf-73e0d748b9acdc40b693f2879ce82ecb1a849b...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File protobuf-73e0d748b9acdc40b693f2879ce82ecb1a849b81.patch of Package protobuf.36265
From 73e0d748b9acdc40b693f2879ce82ecb1a849b81 Mon Sep 17 00:00:00 2001 From: ST-DDT <ST-DDT@gmx.de> Date: Sat, 15 Jun 2019 20:31:31 +0200 Subject: [PATCH] Switch to using enum based methods --- src/google/protobuf/compiler/java/java_doc_comment.cc | 169 ++++++++-- src/google/protobuf/compiler/java/java_doc_comment.h | 32 + src/google/protobuf/compiler/java/java_enum_field.cc | 92 ++--- src/google/protobuf/compiler/java/java_enum_field_lite.cc | 119 +++---- 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 | 54 +-- src/google/protobuf/compiler/java/java_primitive_field_lite.cc | 24 - src/google/protobuf/compiler/java/java_string_field.cc | 79 ++-- src/google/protobuf/compiler/java/java_string_field_lite.cc | 101 +++-- 10 files changed, 442 insertions(+), 264 deletions(-) --- a/src/google/protobuf/compiler/java/java_doc_comment.cc +++ b/src/google/protobuf/compiler/java/java_doc_comment.cc @@ -185,42 +185,177 @@ void WriteFieldDocComment(io::Printer* p printer->Print(" */\n"); } -void WriteFieldGetterDocComment(io::Printer* printer, const FieldDescriptor* field) { +void WriteFieldAccessorDocComment(io::Printer* printer, + const FieldDescriptor* field, + const FieldAccessorType type, + const bool builder) { 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()); + switch (type) { + case HAZZER: + printer->Print(" * @return Whether the $name$ field is set.\n", "name", + field->camelcase_name()); + break; + case GETTER: + printer->Print(" * @return The $name$.\n", "name", + field->camelcase_name()); + break; + case SETTER: + printer->Print(" * @param value The $name$ to set.\n", "name", + field->camelcase_name()); + break; + case CLEARER: + // Print nothing + break; + // Repeated + case LIST_COUNT: + printer->Print(" * @return The number of $name$(s).\n", "name", + field->camelcase_name()); + break; + case LIST_GETTER: + printer->Print(" * @return A list containing the $name$(s).\n", "name", + field->camelcase_name()); + break; + case LIST_INDEXED_GETTER: + printer->Print(" * @param index The index of the element to return.\n"); + printer->Print(" * @return The $name$(s) at the given index.\n", "name", + field->camelcase_name()); + break; + case LIST_INDEXED_SETTER: + printer->Print(" * @param index The index to set the value at.\n"); + printer->Print(" * @param value The $name$ to set.\n", "name", + field->camelcase_name()); + break; + case LIST_ADDER: + printer->Print(" * @param value The $name$ to add.\n", "name", + field->camelcase_name()); + break; + case LIST_MULTI_ADDER: + printer->Print(" * @param values The $name$(s) to add.\n", "name", + field->camelcase_name()); + break; + } + if (builder) { + printer->Print(" * @return This builder for chaining.\n"); + } printer->Print(" */\n"); } -void WriteFieldHaserDocComment(io::Printer* printer, const FieldDescriptor* field) { +void WriteFieldEnumValueAccessorDocComment(io::Printer* printer, + const FieldDescriptor* field, + const FieldAccessorType type, + const bool builder) { printer->Print("/**\n"); WriteDocCommentBody(printer, field); - printer->Print(" * <code>$def$</code>\n", "def", + 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()); + switch (type) { + case HAZZER: + // Should never happen + break; + case GETTER: + printer->Print(" * @return The enum value for $name$.\n", "name", + field->camelcase_name()); + break; + case SETTER: + printer->Print(" * @param value The enum value for $name$ to set.\n", + "name", field->camelcase_name()); + break; + case CLEARER: + // Print nothing + break; + // Repeated + case LIST_COUNT: + // Should never happen + break; + case LIST_GETTER: + printer->Print(" * @return A list containing the enum values for $name$(s).\n", + "name", field->camelcase_name()); + break; + case LIST_INDEXED_GETTER: + printer->Print(" * @param index The index of the value to return.\n"); + printer->Print(" * @return The enum value of the $name$ at the given index.\n", + "name", field->camelcase_name()); + break; + case LIST_INDEXED_SETTER: + printer->Print(" * @param index The index of the value to return.\n"); + printer->Print(" * @param value The enum value of the $name$ to set.\n", + "name", field->camelcase_name()); + break; + case LIST_ADDER: + printer->Print(" * @param value The enum value of the $name$ to add.\n", + "name", field->camelcase_name()); + break; + case LIST_MULTI_ADDER: + printer->Print(" * @param values The enum values of the $name$(s) to add.\n", + "name", field->camelcase_name()); + break; + } + if (builder) { + printer->Print(" * @return This builder for chaining.\n"); + } printer->Print(" */\n"); } -void WriteFieldSetterDocComment(io::Printer* printer, const FieldDescriptor* field) { +void WriteFieldStringBytesAccessorDocComment(io::Printer* printer, + const FieldDescriptor* field, + const FieldAccessorType type, + const bool builder) { printer->Print("/**\n"); WriteDocCommentBody(printer, field); - printer->Print(" * <code>$def$</code>\n", "def", + 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"); + switch (type) { + case HAZZER: + // Should never happen + break; + case GETTER: + printer->Print(" * @return The bytes for $name$.\n", "name", + field->camelcase_name()); + break; + case SETTER: + printer->Print(" * @param value The bytes for $name$ to set.\n", + "name", field->camelcase_name()); + break; + case CLEARER: + // Print nothing + break; + // Repeated + case LIST_COUNT: + // Should never happen + break; + case LIST_GETTER: + printer->Print(" * @return A list containing the bytes for $name$(s).\n", + "name", field->camelcase_name()); + break; + case LIST_INDEXED_GETTER: + printer->Print(" * @param index The index of the value to return.\n"); + printer->Print(" * @return The bytes of the $name$ at the given index.\n", + "name", field->camelcase_name()); + break; + case LIST_INDEXED_SETTER: + printer->Print(" * @param index The index of the value to return.\n"); + printer->Print(" * @param value The bytes of the $name$ to set.\n", + "name", field->camelcase_name()); + break; + case LIST_ADDER: + printer->Print(" * @param value The bytes of the $name$ to add.\n", + "name", field->camelcase_name()); + break; + case LIST_MULTI_ADDER: + printer->Print(" * @param values The bytes of the $name$(s) to add.\n", + "name", field->camelcase_name()); + break; + } + if (builder) { + 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"); -} +// Enum void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enum_) { printer->Print("/**\n"); --- a/src/google/protobuf/compiler/java/java_doc_comment.h +++ b/src/google/protobuf/compiler/java/java_doc_comment.h @@ -52,12 +52,36 @@ namespace protobuf { namespace compiler { namespace java { +enum FieldAccessorType { + + HAZZER, + GETTER, + SETTER, + CLEARER, + // Repeated + LIST_COUNT, + LIST_GETTER, + LIST_INDEXED_GETTER, + LIST_INDEXED_SETTER, + LIST_ADDER, + LIST_MULTI_ADDER + +}; + 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 WriteFieldAccessorDocComment(io::Printer* printer, + const FieldDescriptor* field, + const FieldAccessorType type, + const bool builder = false); +void WriteFieldEnumValueAccessorDocComment(io::Printer* printer, + const FieldDescriptor* field, + const FieldAccessorType type, + const bool builder = false); +void WriteFieldStringBytesAccessorDocComment(io::Printer* printer, + const FieldDescriptor* field, + const FieldAccessorType type, + const bool builder = false); void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enum_); void WriteEnumValueDocComment(io::Printer* printer, const EnumValueDescriptor* value); --- a/src/google/protobuf/compiler/java/java_enum_field.cc +++ b/src/google/protobuf/compiler/java/java_enum_field.cc @@ -156,16 +156,16 @@ int ImmutableEnumFieldGenerator::GetNumB void ImmutableEnumFieldGenerator::GenerateInterfaceMembers( io::Printer* printer) const { if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print(variables_, "$deprecation$boolean has$capitalized_name$();\n"); } if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$int get$capitalized_name$Value();\n"); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n"); } @@ -173,7 +173,7 @@ void ImmutableEnumFieldGenerator::Genera printer->Print(variables_, "private int $name$_;\n"); PrintExtraFieldInfo(variables_, printer); if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" @@ -182,7 +182,7 @@ void ImmutableEnumFieldGenerator::Genera printer->Annotate("{", "}", descriptor_); } if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" @@ -190,7 +190,7 @@ void ImmutableEnumFieldGenerator::Genera "}\n"); printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " @SuppressWarnings(\"deprecation\")\n" @@ -204,7 +204,7 @@ void ImmutableEnumFieldGenerator::Genera io::Printer* printer) const { printer->Print(variables_, "private int $name$_ = $default_number$;\n"); if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" @@ -213,14 +213,14 @@ void ImmutableEnumFieldGenerator::Genera printer->Annotate("{", "}", descriptor_); } if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" " return $name$_;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, "$deprecation$public Builder " "${$set$capitalized_name$Value$}$(int value) {\n" @@ -230,7 +230,7 @@ void ImmutableEnumFieldGenerator::Genera "}\n"); printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " @SuppressWarnings(\"deprecation\")\n" @@ -238,7 +238,7 @@ void ImmutableEnumFieldGenerator::Genera " return result == null ? $unknown$ : result;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print(variables_, "$deprecation$public Builder " "${$set$capitalized_name$$}$($type$ value) {\n" @@ -251,7 +251,7 @@ void ImmutableEnumFieldGenerator::Genera " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -385,7 +385,7 @@ void ImmutableEnumOneofFieldGenerator::G io::Printer* printer) const { PrintExtraFieldInfo(variables_, printer); if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" @@ -394,7 +394,7 @@ void ImmutableEnumOneofFieldGenerator::G printer->Annotate("{", "}", descriptor_); } if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" @@ -405,7 +405,7 @@ void ImmutableEnumOneofFieldGenerator::G "}\n"); printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " if ($has_oneof_case_message$) {\n" @@ -422,7 +422,7 @@ void ImmutableEnumOneofFieldGenerator::G void ImmutableEnumOneofFieldGenerator::GenerateBuilderMembers( io::Printer* printer) const { if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" @@ -431,7 +431,7 @@ void ImmutableEnumOneofFieldGenerator::G printer->Annotate("{", "}", descriptor_); } if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" @@ -441,7 +441,7 @@ void ImmutableEnumOneofFieldGenerator::G " return $default_number$;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print(variables_, "$deprecation$public Builder " "${$set$capitalized_name$Value$}$(int value) {\n" @@ -452,7 +452,7 @@ void ImmutableEnumOneofFieldGenerator::G "}\n"); printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " if ($has_oneof_case_message$) {\n" @@ -464,7 +464,7 @@ void ImmutableEnumOneofFieldGenerator::G " return $default$;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print(variables_, "$deprecation$public Builder " "${$set$capitalized_name$$}$($type$ value) {\n" @@ -477,7 +477,7 @@ void ImmutableEnumOneofFieldGenerator::G " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -603,22 +603,23 @@ int RepeatedImmutableEnumFieldGenerator: void RepeatedImmutableEnumFieldGenerator::GenerateInterfaceMembers( io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print( variables_, "$deprecation$java.util.List<$type$> get$capitalized_name$List();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print(variables_, "$deprecation$int get$capitalized_name$Count();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$(int index);\n"); if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "$deprecation$java.util.List<java.lang.Integer>\n" "get$capitalized_name$ValueList();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, + LIST_INDEXED_GETTER); printer->Print(variables_, "$deprecation$int get$capitalized_name$Value(int index);\n"); } @@ -641,7 +642,7 @@ void RepeatedImmutableEnumFieldGenerator " }\n" " };\n"); PrintExtraFieldInfo(variables_, printer); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print( variables_, "$deprecation$public java.util.List<$type$> " @@ -650,14 +651,14 @@ void RepeatedImmutableEnumFieldGenerator " java.lang.Integer, $type$>($name$_, $name$_converter_);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER); printer->Print( variables_, "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return $name$_.size();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" @@ -665,14 +666,15 @@ void RepeatedImmutableEnumFieldGenerator "}\n"); printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "$deprecation$public java.util.List<java.lang.Integer>\n" "${$get$capitalized_name$ValueList$}$() {\n" " return $name$_;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, + LIST_INDEXED_GETTER); printer->Print(variables_, "$deprecation$public int " "${$get$capitalized_name$Value$}$(int index) {\n" @@ -709,7 +711,7 @@ void RepeatedImmutableEnumFieldGenerator " }\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print( variables_, // Note: We return an unmodifiable list because otherwise the caller @@ -722,21 +724,21 @@ void RepeatedImmutableEnumFieldGenerator " java.lang.Integer, $type$>($name$_, $name$_converter_);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return $name$_.size();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" " return $name$_converter_.convert($name$_.get(index));\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, true); printer->Print(variables_, "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" " int index, $type$ value) {\n" @@ -749,7 +751,7 @@ void RepeatedImmutableEnumFieldGenerator " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, true); printer->Print(variables_, "$deprecation$public Builder " "${$add$capitalized_name$$}$($type$ value) {\n" @@ -762,7 +764,7 @@ void RepeatedImmutableEnumFieldGenerator " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, true); printer->Print(variables_, "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" " java.lang.Iterable<? extends $type$> values) {\n" @@ -774,7 +776,7 @@ void RepeatedImmutableEnumFieldGenerator " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -786,21 +788,23 @@ void RepeatedImmutableEnumFieldGenerator printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "$deprecation$public java.util.List<java.lang.Integer>\n" "${$get$capitalized_name$ValueList$}$() {\n" " return java.util.Collections.unmodifiableList($name$_);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, + LIST_INDEXED_GETTER); printer->Print(variables_, "$deprecation$public int " "${$get$capitalized_name$Value$}$(int index) {\n" " return $name$_.get(index);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, + LIST_INDEXED_GETTER, true); printer->Print( variables_, "$deprecation$public Builder ${$set$capitalized_name$Value$}$(\n" @@ -811,7 +815,8 @@ void RepeatedImmutableEnumFieldGenerator " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER, + true); printer->Print(variables_, "$deprecation$public Builder " "${$add$capitalized_name$Value$}$(int value) {\n" @@ -821,7 +826,8 @@ void RepeatedImmutableEnumFieldGenerator " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER, + true); printer->Print( variables_, "$deprecation$public Builder ${$addAll$capitalized_name$Value$}$(\n" --- a/src/google/protobuf/compiler/java/java_enum_field_lite.cc +++ b/src/google/protobuf/compiler/java/java_enum_field_lite.cc @@ -143,16 +143,16 @@ int ImmutableEnumFieldLiteGenerator::Get void ImmutableEnumFieldLiteGenerator::GenerateInterfaceMembers( io::Printer* printer) const { if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print(variables_, "$deprecation$boolean has$capitalized_name$();\n"); } if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$int get$capitalized_name$Value();\n"); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n"); } @@ -161,7 +161,7 @@ void ImmutableEnumFieldLiteGenerator::Ge printer->Print(variables_, "private int $name$_;\n"); PrintExtraFieldInfo(variables_, printer); if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "@java.lang.Override\n" @@ -171,7 +171,7 @@ void ImmutableEnumFieldLiteGenerator::Ge printer->Annotate("{", "}", descriptor_); } if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "@java.lang.Override\n" @@ -180,7 +180,7 @@ void ImmutableEnumFieldLiteGenerator::Ge "}\n"); printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" @@ -191,14 +191,14 @@ void ImmutableEnumFieldLiteGenerator::Ge // Generate private setters for the builder to proxy into. if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, "private void set$capitalized_name$Value(int value) {\n" " $set_has_field_bit_message$" " $name$_ = value;\n" "}\n"); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, "private void set$capitalized_name$($type$ value) {\n" " if (value == null) {\n" @@ -207,7 +207,7 @@ void ImmutableEnumFieldLiteGenerator::Ge " $set_has_field_bit_message$\n" " $name$_ = value.getNumber();\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); printer->Print(variables_, "private void clear$capitalized_name$() {\n" " $clear_has_field_bit_message$\n" @@ -218,7 +218,7 @@ void ImmutableEnumFieldLiteGenerator::Ge void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( io::Printer* printer) const { if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "@java.lang.Override\n" @@ -228,7 +228,7 @@ void ImmutableEnumFieldLiteGenerator::Ge printer->Annotate("{", "}", descriptor_); } if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "@java.lang.Override\n" @@ -236,7 +236,7 @@ void ImmutableEnumFieldLiteGenerator::Ge " return instance.get$capitalized_name$Value();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print(variables_, "$deprecation$public Builder " "${$set$capitalized_name$Value$}$(int value) {\n" @@ -246,14 +246,14 @@ void ImmutableEnumFieldLiteGenerator::Ge "}\n"); printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return instance.get$capitalized_name$();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print(variables_, "$deprecation$public Builder " "${$set$capitalized_name$$}$($type$ value) {\n" @@ -262,7 +262,7 @@ void ImmutableEnumFieldLiteGenerator::Ge " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -317,7 +317,7 @@ void ImmutableEnumOneofFieldLiteGenerato io::Printer* printer) const { PrintExtraFieldInfo(variables_, printer); if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "@java.lang.Override\n" @@ -327,7 +327,7 @@ void ImmutableEnumOneofFieldLiteGenerato printer->Annotate("{", "}", descriptor_); } if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "@java.lang.Override\n" @@ -339,7 +339,7 @@ void ImmutableEnumOneofFieldLiteGenerato "}\n"); printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" @@ -354,14 +354,14 @@ void ImmutableEnumOneofFieldLiteGenerato // Generate private setters for the builder to proxy into. if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, "private void set$capitalized_name$Value(int value) {\n" " $set_oneof_case_message$;\n" " $oneof_name$_ = value;\n" "}\n"); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, "private void set$capitalized_name$($type$ value) {\n" " if (value == null) {\n" @@ -370,7 +370,7 @@ void ImmutableEnumOneofFieldLiteGenerato " $set_oneof_case_message$;\n" " $oneof_name$_ = value.getNumber();\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); printer->Print(variables_, "private void clear$capitalized_name$() {\n" " if ($has_oneof_case_message$) {\n" @@ -397,7 +397,7 @@ void ImmutableEnumOneofFieldLiteGenerato void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers( io::Printer* printer) const { if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "@java.lang.Override\n" @@ -407,7 +407,7 @@ void ImmutableEnumOneofFieldLiteGenerato printer->Annotate("{", "}", descriptor_); } if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "@java.lang.Override\n" @@ -415,7 +415,7 @@ void ImmutableEnumOneofFieldLiteGenerato " return instance.get$capitalized_name$Value();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print(variables_, "$deprecation$public Builder " "${$set$capitalized_name$Value$}$(int value) {\n" @@ -425,14 +425,14 @@ void ImmutableEnumOneofFieldLiteGenerato "}\n"); printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return instance.get$capitalized_name$();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print(variables_, "$deprecation$public Builder " "${$set$capitalized_name$$}$($type$ value) {\n" @@ -441,7 +441,7 @@ void ImmutableEnumOneofFieldLiteGenerato " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -475,22 +475,23 @@ int RepeatedImmutableEnumFieldLiteGenera void RepeatedImmutableEnumFieldLiteGenerator::GenerateInterfaceMembers( io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print( variables_, "$deprecation$java.util.List<$type$> get$capitalized_name$List();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print(variables_, "$deprecation$int get$capitalized_name$Count();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$(int index);\n"); if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "$deprecation$java.util.List<java.lang.Integer>\n" "get$capitalized_name$ValueList();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, + LIST_INDEXED_GETTER); printer->Print(variables_, "$deprecation$int get$capitalized_name$Value(int index);\n"); } @@ -513,7 +514,7 @@ void RepeatedImmutableEnumFieldLiteGener " }\n" " };\n"); PrintExtraFieldInfo(variables_, printer); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print( variables_, "@java.lang.Override\n" @@ -523,7 +524,7 @@ void RepeatedImmutableEnumFieldLiteGener " java.lang.Integer, $type$>($name$_, $name$_converter_);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, "@java.lang.Override\n" @@ -531,7 +532,7 @@ void RepeatedImmutableEnumFieldLiteGener " return $name$_.size();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, "@java.lang.Override\n" @@ -540,7 +541,7 @@ void RepeatedImmutableEnumFieldLiteGener "}\n"); printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public java.util.List<java.lang.Integer>\n" @@ -548,7 +549,8 @@ void RepeatedImmutableEnumFieldLiteGener " return $name$_;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, + LIST_INDEXED_GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public int " @@ -572,7 +574,7 @@ void RepeatedImmutableEnumFieldLiteGener " com.google.protobuf.GeneratedMessageLite.mutableCopy($name$_);\n" " }\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER); printer->Print(variables_, "private void set$capitalized_name$(\n" " int index, $type$ value) {\n" @@ -582,7 +584,7 @@ void RepeatedImmutableEnumFieldLiteGener " ensure$capitalized_name$IsMutable();\n" " $name$_.setInt(index, value.getNumber());\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER); printer->Print(variables_, "private void add$capitalized_name$($type$ value) {\n" " if (value == null) {\n" @@ -591,7 +593,7 @@ void RepeatedImmutableEnumFieldLiteGener " ensure$capitalized_name$IsMutable();\n" " $name$_.addInt(value.getNumber());\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER); printer->Print(variables_, "private void addAll$capitalized_name$(\n" " java.lang.Iterable<? extends $type$> values) {\n" @@ -600,27 +602,28 @@ void RepeatedImmutableEnumFieldLiteGener " $name$_.addInt(value.getNumber());\n" " }\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); printer->Print(variables_, "private void clear$capitalized_name$() {\n" " $name$_ = emptyIntList();\n" "}\n"); if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, "private void set$capitalized_name$Value(\n" " int index, int value) {\n" " ensure$capitalized_name$IsMutable();\n" " $name$_.setInt(index, value);\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER); printer->Print(variables_, "private void add$capitalized_name$Value(int value) {\n" " ensure$capitalized_name$IsMutable();\n" " $name$_.addInt(value);\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, + LIST_MULTI_ADDER); printer->Print(variables_, "private void addAll$capitalized_name$Value(\n" " java.lang.Iterable<java.lang.Integer> values) {\n" @@ -648,7 +651,7 @@ void RepeatedImmutableEnumFieldLiteGener void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public java.util.List<$type$> " @@ -656,7 +659,7 @@ void RepeatedImmutableEnumFieldLiteGener " return instance.get$capitalized_name$List();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, "@java.lang.Override\n" @@ -664,7 +667,7 @@ void RepeatedImmutableEnumFieldLiteGener " return instance.get$capitalized_name$Count();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, "@java.lang.Override\n" @@ -672,7 +675,7 @@ void RepeatedImmutableEnumFieldLiteGener " return instance.get$capitalized_name$(index);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, true); printer->Print(variables_, "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" " int index, $type$ value) {\n" @@ -681,7 +684,7 @@ void RepeatedImmutableEnumFieldLiteGener " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, true); printer->Print(variables_, "$deprecation$public Builder " "${$add$capitalized_name$$}$($type$ value) {\n" @@ -690,7 +693,7 @@ void RepeatedImmutableEnumFieldLiteGener " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, true); printer->Print(variables_, "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" " java.lang.Iterable<? extends $type$> values) {\n" @@ -699,7 +702,7 @@ void RepeatedImmutableEnumFieldLiteGener " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -710,7 +713,7 @@ void RepeatedImmutableEnumFieldLiteGener printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public java.util.List<java.lang.Integer>\n" @@ -719,7 +722,8 @@ void RepeatedImmutableEnumFieldLiteGener " instance.get$capitalized_name$ValueList());\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, + LIST_INDEXED_GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public int " @@ -727,7 +731,8 @@ void RepeatedImmutableEnumFieldLiteGener " return instance.get$capitalized_name$Value(index);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, + LIST_INDEXED_SETTER, true); printer->Print( variables_, "$deprecation$public Builder ${$set$capitalized_name$Value$}$(\n" @@ -737,7 +742,8 @@ void RepeatedImmutableEnumFieldLiteGener " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER, + true); printer->Print(variables_, "$deprecation$public Builder " "${$add$capitalized_name$Value$}$(int value) {\n" @@ -745,7 +751,8 @@ void RepeatedImmutableEnumFieldLiteGener " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldEnumValueAccessorDocComment(printer, descriptor_, + LIST_MULTI_ADDER, true); printer->Print( variables_, "$deprecation$public Builder ${$addAll$capitalized_name$Value$}$(\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. - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print(variables_, "$deprecation$boolean has$capitalized_name$();\n"); - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n"); - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldDocComment(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())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_message$;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" @@ -185,14 +185,14 @@ void ImmutableMessageFieldGenerator::Gen "}\n"); printer->Annotate("{", "}", descriptor_); } else { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $name$_ != null;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); 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() - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); if (support_field_presence) { printer->Print( variables_, @@ -279,14 +279,14 @@ void ImmutableMessageFieldGenerator::Gen } // Field getField() - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); 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) - WriteFieldSetterDocComment(printer, descriptor_); + WriteFieldDocComment(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) - WriteFieldSetterDocComment(printer, descriptor_); + WriteFieldDocComment(printer, descriptor_); PrintNestedBuilderFunction( printer, "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" @@ -347,7 +347,7 @@ void ImmutableMessageFieldGenerator::Gen "return this;\n"); // Field.Builder clearField() - WriteFieldClearerDocComment(printer, descriptor_); + WriteFieldDocComment(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); - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print(variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $has_oneof_case_message$;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); 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() - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); 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() - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); 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 { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print(variables_, "$deprecation$boolean has$capitalized_name$();\n"); - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); 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 @@ -206,11 +206,11 @@ int ImmutablePrimitiveFieldGenerator::Ge void ImmutablePrimitiveFieldGenerator::GenerateInterfaceMembers( io::Printer* printer) const { if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print(variables_, "$deprecation$boolean has$capitalized_name$();\n"); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$();\n"); } @@ -219,7 +219,7 @@ void ImmutablePrimitiveFieldGenerator::G printer->Print(variables_, "private $field_type$ $name$_;\n"); PrintExtraFieldInfo(variables_, printer); if (SupportFieldPresence(descriptor_->file())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" @@ -228,7 +228,7 @@ void ImmutablePrimitiveFieldGenerator::G printer->Annotate("{", "}", descriptor_); } - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); 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())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" @@ -250,14 +250,14 @@ void ImmutablePrimitiveFieldGenerator::G printer->Annotate("{", "}", descriptor_); } - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return $name$_;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print(variables_, "$deprecation$public Builder " "${$set$capitalized_name$$}$($type$ value) {\n" @@ -269,7 +269,7 @@ void ImmutablePrimitiveFieldGenerator::G "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -492,7 +492,7 @@ void ImmutablePrimitiveOneofFieldGenerat io::Printer* printer) const { PrintExtraFieldInfo(variables_, printer); if (SupportFieldPresence(descriptor_->file())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" @@ -501,7 +501,7 @@ void ImmutablePrimitiveOneofFieldGenerat printer->Annotate("{", "}", descriptor_); } - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); 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())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" @@ -524,7 +524,7 @@ void ImmutablePrimitiveOneofFieldGenerat printer->Annotate("{", "}", descriptor_); } - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " if ($has_oneof_case_message$) {\n" @@ -534,7 +534,7 @@ void ImmutablePrimitiveOneofFieldGenerat "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print(variables_, "$deprecation$public Builder " "${$set$capitalized_name$$}$($type$ value) {\n" @@ -546,7 +546,7 @@ void ImmutablePrimitiveOneofFieldGenerat "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -642,14 +642,14 @@ int RepeatedImmutablePrimitiveFieldGener void RepeatedImmutablePrimitiveFieldGenerator::GenerateInterfaceMembers( io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "$deprecation$java.util.List<$boxed_type$> " "get$capitalized_name$List();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print(variables_, "$deprecation$int get$capitalized_name$Count();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, "$deprecation$$type$ get$capitalized_name$(int index);\n"); } @@ -658,21 +658,21 @@ void RepeatedImmutablePrimitiveFieldGene io::Printer* printer) const { printer->Print(variables_, "private $field_list_type$ $name$_;\n"); PrintExtraFieldInfo(variables_, printer); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "$deprecation$public java.util.List<$boxed_type$>\n" " ${$get$capitalized_name$List$}$() {\n" " return $name$_;\n" // note: unmodifiable list "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return $name$_.size();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" @@ -712,7 +712,7 @@ void RepeatedImmutablePrimitiveFieldGene // could hold on to the returned list and modify it after the message // has been built, thus mutating the message which is supposed to be // immutable. - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print( variables_, "$deprecation$public java.util.List<$boxed_type$>\n" @@ -721,21 +721,21 @@ void RepeatedImmutablePrimitiveFieldGene " java.util.Collections.unmodifiableList($name$_) : $name$_;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return $name$_.size();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" " return $repeated_get$(index);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, true); printer->Print(variables_, "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" " int index, $type$ value) {\n" @@ -746,7 +746,7 @@ void RepeatedImmutablePrimitiveFieldGene " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, true); printer->Print(variables_, "$deprecation$public Builder " "${$add$capitalized_name$$}$($type$ value) {\n" @@ -757,7 +757,7 @@ void RepeatedImmutablePrimitiveFieldGene " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, true); printer->Print(variables_, "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" " java.lang.Iterable<? extends $boxed_type$> values) {\n" @@ -768,7 +768,7 @@ void RepeatedImmutablePrimitiveFieldGene " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\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())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print(variables_, "$deprecation$boolean has$capitalized_name$();\n"); } - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); 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())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "@java.lang.Override\n" @@ -228,7 +228,7 @@ void ImmutablePrimitiveFieldLiteGenerato printer->Annotate("{", "}", descriptor_); } - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" @@ -236,7 +236,7 @@ void ImmutablePrimitiveFieldLiteGenerato "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, "private void set$capitalized_name$($type$ value) {\n" "$null_check$" @@ -244,7 +244,7 @@ void ImmutablePrimitiveFieldLiteGenerato " $name$_ = value;\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); printer->Print(variables_, "private void clear$capitalized_name$() {\n" " $clear_has_field_bit_message$\n"); @@ -264,7 +264,7 @@ void ImmutablePrimitiveFieldLiteGenerato void ImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( io::Printer* printer) const { if (SupportFieldPresence(descriptor_->file())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "@java.lang.Override\n" @@ -274,7 +274,7 @@ void ImmutablePrimitiveFieldLiteGenerato printer->Annotate("{", "}", descriptor_); } - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); 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())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "@java.lang.Override\n" @@ -357,7 +357,7 @@ void ImmutablePrimitiveOneofFieldLiteGen printer->Annotate("{", "}", descriptor_); } - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); 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())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "@java.lang.Override\n" @@ -407,7 +407,7 @@ void ImmutablePrimitiveOneofFieldLiteGen printer->Annotate("{", "}", descriptor_); } - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); 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())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print(variables_, "$deprecation$boolean has$capitalized_name$();\n"); } - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$java.lang.String get$capitalized_name$();\n"); - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); 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())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" @@ -218,7 +218,7 @@ void ImmutableStringFieldGenerator::Gene printer->Annotate("{", "}", descriptor_); } - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" @@ -242,7 +242,7 @@ void ImmutableStringFieldGenerator::Gene " return s;\n" " }\n" "}\n"); - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); 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())) { - WriteFieldHaserDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" @@ -274,7 +274,7 @@ void ImmutableStringFieldGenerator::Gene printer->Annotate("{", "}", descriptor_); } - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" @@ -299,7 +299,7 @@ void ImmutableStringFieldGenerator::Gene " }\n" "}\n"); - WriteFieldGetterDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); 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_); - WriteFieldSetterDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true); 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_); - WriteFieldClearerDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -342,7 +342,7 @@ void ImmutableStringFieldGenerator::Gene " return this;\n" "}\n"); - WriteFieldSetterDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER); printer->Print( variables_, "$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n" @@ -481,7 +481,7 @@ void ImmutableStringOneofFieldGenerator: PrintExtraFieldInfo(variables_, printer); if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" @@ -490,7 +490,7 @@ void ImmutableStringOneofFieldGenerator: printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" @@ -520,7 +520,7 @@ void ImmutableStringOneofFieldGenerator: " return s;\n" " }\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$public com.google.protobuf.ByteString\n" @@ -547,7 +547,7 @@ void ImmutableStringOneofFieldGenerator: void ImmutableStringOneofFieldGenerator::GenerateBuilderMembers( io::Printer* printer) const { if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" @@ -556,7 +556,7 @@ void ImmutableStringOneofFieldGenerator: printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" @@ -586,7 +586,7 @@ void ImmutableStringOneofFieldGenerator: " }\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$public com.google.protobuf.ByteString\n" " ${$get$capitalized_name$Bytes$}$() {\n" @@ -608,7 +608,7 @@ void ImmutableStringOneofFieldGenerator: "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print(variables_, "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" " java.lang.String value) {\n" @@ -619,7 +619,7 @@ void ImmutableStringOneofFieldGenerator: " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -632,7 +632,7 @@ void ImmutableStringOneofFieldGenerator: "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print( variables_, "$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n" @@ -723,7 +723,7 @@ int RepeatedImmutableStringFieldGenerato void RepeatedImmutableStringFieldGenerator::GenerateInterfaceMembers( io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print( variables_, // NOTE: the same method in the implementation class actually returns @@ -734,14 +734,15 @@ void RepeatedImmutableStringFieldGenerat // with different return types exist in the compiled byte code. "$deprecation$java.util.List<java.lang.String>\n" " get$capitalized_name$List();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print(variables_, "$deprecation$int get$capitalized_name$Count();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, "$deprecation$java.lang.String get$capitalized_name$(int index);\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, + LIST_INDEXED_GETTER); printer->Print(variables_, "$deprecation$com.google.protobuf.ByteString\n" " get$capitalized_name$Bytes(int index);\n"); @@ -752,28 +753,29 @@ void RepeatedImmutableStringFieldGenerat printer->Print(variables_, "private com.google.protobuf.LazyStringList $name$_;\n"); PrintExtraFieldInfo(variables_, printer); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "$deprecation$public com.google.protobuf.ProtocolStringList\n" " ${$get$capitalized_name$List$}$() {\n" " return $name$_;\n" // note: unmodifiable list "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return $name$_.size();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, "$deprecation$public java.lang.String " "${$get$capitalized_name$$}$(int index) {\n" " return $name$_.get(index);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, + LIST_INDEXED_GETTER); printer->Print(variables_, "$deprecation$public com.google.protobuf.ByteString\n" " ${$get$capitalized_name$Bytes$}$(int index) {\n" @@ -810,35 +812,35 @@ void RepeatedImmutableStringFieldGenerat // could hold on to the returned list and modify it after the message // has been built, thus mutating the message which is supposed to be // immutable. - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "$deprecation$public com.google.protobuf.ProtocolStringList\n" " ${$get$capitalized_name$List$}$() {\n" " return $name$_.getUnmodifiableView();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return $name$_.size();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, "$deprecation$public java.lang.String " "${$get$capitalized_name$$}$(int index) {\n" " return $name$_.get(index);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_ADDER); printer->Print(variables_, "$deprecation$public com.google.protobuf.ByteString\n" " ${$get$capitalized_name$Bytes$}$(int index) {\n" " return $name$_.getByteString(index);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, true); printer->Print(variables_, "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" " int index, java.lang.String value) {\n" @@ -849,7 +851,7 @@ void RepeatedImmutableStringFieldGenerat " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, true); printer->Print(variables_, "$deprecation$public Builder ${$add$capitalized_name$$}$(\n" " java.lang.String value) {\n" @@ -860,7 +862,7 @@ void RepeatedImmutableStringFieldGenerat " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, true); printer->Print(variables_, "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" " java.lang.Iterable<java.lang.String> values) {\n" @@ -871,7 +873,7 @@ void RepeatedImmutableStringFieldGenerat " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -882,7 +884,8 @@ void RepeatedImmutableStringFieldGenerat "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_ADDER, + true); printer->Print( variables_, "$deprecation$public Builder ${$add$capitalized_name$Bytes$}$(\n" --- a/src/google/protobuf/compiler/java/java_string_field_lite.cc +++ b/src/google/protobuf/compiler/java/java_string_field_lite.cc @@ -163,14 +163,14 @@ int ImmutableStringFieldLiteGenerator::G void ImmutableStringFieldLiteGenerator::GenerateInterfaceMembers( io::Printer* printer) const { if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print(variables_, "$deprecation$boolean has$capitalized_name$();\n"); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$java.lang.String get$capitalized_name$();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "$deprecation$com.google.protobuf.ByteString\n" " get$capitalized_name$Bytes();\n"); @@ -182,7 +182,7 @@ void ImmutableStringFieldLiteGenerator:: PrintExtraFieldInfo(variables_, printer); if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "@java.lang.Override\n" @@ -192,7 +192,7 @@ void ImmutableStringFieldLiteGenerator:: printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "@java.lang.Override\n" @@ -200,7 +200,7 @@ void ImmutableStringFieldLiteGenerator:: " return $name$_;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "@java.lang.Override\n" @@ -210,7 +210,7 @@ void ImmutableStringFieldLiteGenerator:: "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, "private void set$capitalized_name$(\n" " java.lang.String value) {\n" @@ -218,7 +218,7 @@ void ImmutableStringFieldLiteGenerator:: " $set_has_field_bit_message$\n" " $name$_ = value;\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); printer->Print(variables_, "private void clear$capitalized_name$() {\n" " $clear_has_field_bit_message$\n" @@ -228,7 +228,7 @@ void ImmutableStringFieldLiteGenerator:: " $name$_ = getDefaultInstance().get$capitalized_name$();\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, "private void set$capitalized_name$Bytes(\n" " com.google.protobuf.ByteString value) {\n" @@ -245,7 +245,7 @@ void ImmutableStringFieldLiteGenerator:: void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers( io::Printer* printer) const { if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "@java.lang.Override\n" @@ -255,7 +255,7 @@ void ImmutableStringFieldLiteGenerator:: printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "@java.lang.Override\n" @@ -264,7 +264,7 @@ void ImmutableStringFieldLiteGenerator:: "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public com.google.protobuf.ByteString\n" @@ -273,7 +273,7 @@ void ImmutableStringFieldLiteGenerator:: "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print(variables_, "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" " java.lang.String value) {\n" @@ -282,7 +282,7 @@ void ImmutableStringFieldLiteGenerator:: " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -292,7 +292,7 @@ void ImmutableStringFieldLiteGenerator:: "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print( variables_, "$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n" @@ -342,7 +342,7 @@ void ImmutableStringOneofFieldLiteGenera PrintExtraFieldInfo(variables_, printer); if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "@java.lang.Override\n" @@ -352,7 +352,7 @@ void ImmutableStringOneofFieldLiteGenera printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "@java.lang.Override\n" @@ -364,8 +364,8 @@ void ImmutableStringOneofFieldLiteGenera " return ref;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public com.google.protobuf.ByteString\n" @@ -378,7 +378,7 @@ void ImmutableStringOneofFieldLiteGenera "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, "private void ${$set$capitalized_name$$}$(\n" " java.lang.String value) {\n" @@ -387,7 +387,7 @@ void ImmutableStringOneofFieldLiteGenera " $oneof_name$_ = value;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); printer->Print(variables_, "private void ${$clear$capitalized_name$$}$() {\n" " if ($has_oneof_case_message$) {\n" @@ -397,7 +397,7 @@ void ImmutableStringOneofFieldLiteGenera "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, "private void ${$set$capitalized_name$Bytes$}$(\n" " com.google.protobuf.ByteString value) {\n" @@ -423,7 +423,7 @@ void ImmutableStringOneofFieldLiteGenera void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers( io::Printer* printer) const { if (SupportFieldPresence(descriptor_->file())) { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( variables_, "@java.lang.Override\n" @@ -433,7 +433,7 @@ void ImmutableStringOneofFieldLiteGenera printer->Annotate("{", "}", descriptor_); } - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, "@java.lang.Override\n" @@ -442,7 +442,7 @@ void ImmutableStringOneofFieldLiteGenera "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public com.google.protobuf.ByteString\n" @@ -451,7 +451,7 @@ void ImmutableStringOneofFieldLiteGenera "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, SETTER, true); printer->Print(variables_, "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" " java.lang.String value) {\n" @@ -460,7 +460,7 @@ void ImmutableStringOneofFieldLiteGenera " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -470,7 +470,7 @@ void ImmutableStringOneofFieldLiteGenera "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER); printer->Print( variables_, "$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n" @@ -503,18 +503,18 @@ int RepeatedImmutableStringFieldLiteGene void RepeatedImmutableStringFieldLiteGenerator::GenerateInterfaceMembers( io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "$deprecation$java.util.List<java.lang.String>\n" " get$capitalized_name$List();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print(variables_, "$deprecation$int get$capitalized_name$Count();\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, "$deprecation$java.lang.String get$capitalized_name$(int index);\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, "$deprecation$com.google.protobuf.ByteString\n" " get$capitalized_name$Bytes(int index);\n"); @@ -527,7 +527,7 @@ void RepeatedImmutableStringFieldLiteGen "private com.google.protobuf.Internal.ProtobufList<java.lang.String> " "$name$_;\n"); PrintExtraFieldInfo(variables_, printer); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public java.util.List<java.lang.String> " @@ -535,7 +535,7 @@ void RepeatedImmutableStringFieldLiteGen " return $name$_;\n" // note: unmodifiable list "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, "@java.lang.Override\n" @@ -543,7 +543,7 @@ void RepeatedImmutableStringFieldLiteGen " return $name$_.size();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public java.lang.String " @@ -551,7 +551,8 @@ void RepeatedImmutableStringFieldLiteGen " return $name$_.get(index);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, + LIST_INDEXED_GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public com.google.protobuf.ByteString\n" @@ -570,7 +571,7 @@ void RepeatedImmutableStringFieldLiteGen " }\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER); printer->Print(variables_, "private void set$capitalized_name$(\n" " int index, java.lang.String value) {\n" @@ -578,7 +579,7 @@ void RepeatedImmutableStringFieldLiteGen " ensure$capitalized_name$IsMutable();\n" " $name$_.set(index, value);\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER); printer->Print(variables_, "private void add$capitalized_name$(\n" " java.lang.String value) {\n" @@ -586,7 +587,7 @@ void RepeatedImmutableStringFieldLiteGen " ensure$capitalized_name$IsMutable();\n" " $name$_.add(value);\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER); printer->Print(variables_, "private void addAll$capitalized_name$(\n" " java.lang.Iterable<java.lang.String> values) {\n" @@ -594,13 +595,13 @@ void RepeatedImmutableStringFieldLiteGen " com.google.protobuf.AbstractMessageLite.addAll(\n" " values, $name$_);\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); printer->Print(variables_, "private void clear$capitalized_name$() {\n" " $name$_ = $empty_list$;\n" "}\n"); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_ADDER); printer->Print(variables_, "private void add$capitalized_name$Bytes(\n" " com.google.protobuf.ByteString value) {\n" @@ -616,7 +617,7 @@ void RepeatedImmutableStringFieldLiteGen void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers( io::Printer* printer) const { - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public java.util.List<java.lang.String>\n" @@ -625,7 +626,7 @@ void RepeatedImmutableStringFieldLiteGen " instance.get$capitalized_name$List());\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, "@java.lang.Override\n" @@ -633,7 +634,7 @@ void RepeatedImmutableStringFieldLiteGen " return instance.get$capitalized_name$Count();\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public java.lang.String " @@ -641,7 +642,8 @@ void RepeatedImmutableStringFieldLiteGen " return instance.get$capitalized_name$(index);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, + LIST_INDEXED_GETTER); printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public com.google.protobuf.ByteString\n" @@ -649,7 +651,7 @@ void RepeatedImmutableStringFieldLiteGen " return instance.get$capitalized_name$Bytes(index);\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, true); printer->Print(variables_, "$deprecation$public Builder ${$set$capitalized_name$$}$(\n" " int index, java.lang.String value) {\n" @@ -658,7 +660,7 @@ void RepeatedImmutableStringFieldLiteGen " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER); printer->Print(variables_, "$deprecation$public Builder ${$add$capitalized_name$$}$(\n" " java.lang.String value) {\n" @@ -667,7 +669,7 @@ void RepeatedImmutableStringFieldLiteGen " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, true); printer->Print(variables_, "$deprecation$public Builder ${$addAll$capitalized_name$$}$(\n" " java.lang.Iterable<java.lang.String> values) {\n" @@ -676,7 +678,7 @@ void RepeatedImmutableStringFieldLiteGen " return this;\n" "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" @@ -686,7 +688,8 @@ void RepeatedImmutableStringFieldLiteGen "}\n"); printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); + WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_ADDER, + true); printer->Print( variables_, "$deprecation$public Builder ${$add$capitalized_name$Bytes$}$(\n"
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor