diff options
author | orivej <orivej@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:01 +0300 |
commit | 2d37894b1b037cf24231090eda8589bbb44fb6fc (patch) | |
tree | be835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/protoc/src/google/protobuf/compiler/java | |
parent | 718c552901d703c502ccbefdfc3c9028d608b947 (diff) | |
download | ydb-2d37894b1b037cf24231090eda8589bbb44fb6fc.tar.gz |
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/protoc/src/google/protobuf/compiler/java')
33 files changed, 640 insertions, 640 deletions
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_context.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_context.cc index 7d9cd14c0a..3403cfca2c 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_context.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_context.cc @@ -49,7 +49,7 @@ Context::Context(const FileDescriptor* file, const Options& options) Context::~Context() {} -ClassNameResolver* Context::GetNameResolver() const { +ClassNameResolver* Context::GetNameResolver() const { return name_resolver_.get(); } @@ -154,7 +154,7 @@ void Context::InitializeFieldGeneratorInfoForFields( for (int i = 0; i < fields.size(); ++i) { const FieldDescriptor* field = fields[i]; FieldGeneratorInfo info; - info.name = CamelCaseFieldName(field); + info.name = CamelCaseFieldName(field); info.capitalized_name = UnderscoresToCapitalizedCamelCase(field); // For fields conflicting with some other fields, we append the field // number to their field names in generated code to avoid conflicts. diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_context.h b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_context.h index 1640802aba..3fa6af1778 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_context.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_context.h @@ -69,7 +69,7 @@ class Context { // Get the name resolver associated with this context. The resolver // can be used to map descriptors to Java class names. - ClassNameResolver* GetNameResolver() const; + ClassNameResolver* GetNameResolver() const; // Get the FieldGeneratorInfo for a given field. const FieldGeneratorInfo* GetFieldGeneratorInfo( @@ -97,10 +97,10 @@ class Context { const std::vector<const FieldDescriptor*>& fields); std::unique_ptr<ClassNameResolver> name_resolver_; - std::map<const FieldDescriptor*, FieldGeneratorInfo> - field_generator_info_map_; - std::map<const OneofDescriptor*, OneofGeneratorInfo> - oneof_generator_info_map_; + std::map<const FieldDescriptor*, FieldGeneratorInfo> + field_generator_info_map_; + std::map<const OneofDescriptor*, OneofGeneratorInfo> + oneof_generator_info_map_; Options options_; GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Context); }; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum.cc index 2233e93bc3..d9070eeaab 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum.cc @@ -108,16 +108,16 @@ void EnumGenerator::Generate(io::Printer* printer) { } else { printer->Print(vars, "$name$($index$, $number$),\n"); } - printer->Annotate("name", canonical_values_[i]); + printer->Annotate("name", canonical_values_[i]); } if (SupportUnknownEnumValue(descriptor_->file())) { if (ordinal_is_index) { - printer->Print("${$UNRECOGNIZED$}$(-1),\n", "{", "", "}", ""); + printer->Print("${$UNRECOGNIZED$}$(-1),\n", "{", "", "}", ""); } else { - printer->Print("${$UNRECOGNIZED$}$(-1, -1),\n", "{", "", "}", ""); + printer->Print("${$UNRECOGNIZED$}$(-1, -1),\n", "{", "", "}", ""); } - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } printer->Print( @@ -134,15 +134,15 @@ void EnumGenerator::Generate(io::Printer* printer) { WriteEnumValueDocComment(printer, aliases_[i].value); printer->Print( vars, "public static final $classname$ $name$ = $canonical_name$;\n"); - printer->Annotate("name", aliases_[i].value); + printer->Annotate("name", aliases_[i].value); } for (int i = 0; i < descriptor_->value_count(); i++) { std::map<TProtoStringType, TProtoStringType> vars; vars["name"] = descriptor_->value(i)->name(); vars["number"] = StrCat(descriptor_->value(i)->number()); - vars["{"] = ""; - vars["}"] = ""; + vars["{"] = ""; + vars["}"] = ""; vars["deprecation"] = descriptor_->value(i)->options().deprecated() ? "@java.lang.Deprecated " : ""; @@ -150,7 +150,7 @@ void EnumGenerator::Generate(io::Printer* printer) { printer->Print(vars, "$deprecation$public static final int ${$$name$_VALUE$}$ = " "$number$;\n"); - printer->Annotate("{", "}", descriptor_->value(i)); + printer->Annotate("{", "}", descriptor_->value(i)); } printer->Print("\n"); @@ -266,10 +266,10 @@ void EnumGenerator::Generate(io::Printer* printer) { // at module init time because it wouldn't work with descriptor.proto, but // we can cache the value the first time getDescriptor() is called. if (descriptor_->containing_type() == NULL) { - // The class generated for the File fully populates the descriptor with - // extensions in both the mutable and immutable cases. (In the mutable api - // this is accomplished by attempting to load the immutable outer class). - printer->Print( + // The class generated for the File fully populates the descriptor with + // extensions in both the mutable and immutable cases. (In the mutable api + // this is accomplished by attempting to load the immutable outer class). + printer->Print( " return $file$.getDescriptor().getEnumTypes().get($index$);\n", "file", name_resolver_->GetClassName(descriptor_->file(), immutable_api_), diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field.cc index 0d7eeca610..318c820198 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field.cc @@ -186,7 +186,7 @@ void ImmutableEnumFieldGenerator::GenerateMembers(io::Printer* printer) const { "${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } if (SupportUnknownEnumValue(descriptor_->file())) { WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); @@ -195,7 +195,7 @@ void ImmutableEnumFieldGenerator::GenerateMembers(io::Printer* printer) const { "${$get$capitalized_name$Value$}$() {\n" " return $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -205,7 +205,7 @@ void ImmutableEnumFieldGenerator::GenerateMembers(io::Printer* printer) const { " $type$ result = $type$.$for_number$($name$_);\n" " return result == null ? $unknown$ : result;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutableEnumFieldGenerator::GenerateBuilderMembers( @@ -218,7 +218,7 @@ void ImmutableEnumFieldGenerator::GenerateBuilderMembers( "${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_builder$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } if (SupportUnknownEnumValue(descriptor_->file())) { WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); @@ -227,7 +227,7 @@ void ImmutableEnumFieldGenerator::GenerateBuilderMembers( "${$get$capitalized_name$Value$}$() {\n" " return $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); printer->Print(variables_, @@ -238,7 +238,7 @@ void ImmutableEnumFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -248,7 +248,7 @@ void ImmutableEnumFieldGenerator::GenerateBuilderMembers( " $type$ result = $type$.$for_number$($name$_);\n" " return result == null ? $unknown$ : result;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); printer->Print(variables_, @@ -262,7 +262,7 @@ void ImmutableEnumFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -443,7 +443,7 @@ void ImmutableEnumOneofFieldGenerator::GenerateMembers( " }\n" " return $default_number$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -456,7 +456,7 @@ void ImmutableEnumOneofFieldGenerator::GenerateMembers( " }\n" " return $default$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutableEnumOneofFieldGenerator::GenerateBuilderMembers( @@ -481,7 +481,7 @@ void ImmutableEnumOneofFieldGenerator::GenerateBuilderMembers( " }\n" " return $default_number$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); printer->Print(variables_, @@ -492,7 +492,7 @@ void ImmutableEnumOneofFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -506,7 +506,7 @@ void ImmutableEnumOneofFieldGenerator::GenerateBuilderMembers( " }\n" " return $default$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); printer->Print(variables_, @@ -520,7 +520,7 @@ void ImmutableEnumOneofFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -533,7 +533,7 @@ void ImmutableEnumOneofFieldGenerator::GenerateBuilderMembers( " }\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutableEnumOneofFieldGenerator::GenerateBuildingCode( @@ -696,7 +696,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateMembers( " return new com.google.protobuf.Internal.ListAdapter<\n" " java.lang.Integer, $type$>($name$_, $name$_converter_);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, @@ -704,7 +704,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateMembers( "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return $name$_.size();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, @@ -712,7 +712,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" " return $name$_converter_.convert($name$_.get(index));\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, @@ -721,7 +721,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateMembers( "${$get$capitalized_name$ValueList$}$() {\n" " return $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, @@ -730,7 +730,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateMembers( "${$get$capitalized_name$Value$}$(int index) {\n" " return $name$_.get(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } if (descriptor_->is_packed()) { @@ -773,21 +773,21 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers( " return new com.google.protobuf.Internal.ListAdapter<\n" " java.lang.Integer, $type$>($name$_, $name$_converter_);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", 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_); + printer->Annotate("{", "}", 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_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, /* builder */ true); printer->Print(variables_, @@ -801,7 +801,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, /* builder */ true); printer->Print(variables_, @@ -815,7 +815,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, /* builder */ true); printer->Print(variables_, @@ -828,7 +828,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -839,7 +839,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); @@ -848,7 +848,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers( "${$get$capitalized_name$ValueList$}$() {\n" " return java.util.Collections.unmodifiableList($name$_);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, @@ -856,7 +856,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers( "${$get$capitalized_name$Value$}$(int index) {\n" " return $name$_.get(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER, /* builder */ true); @@ -869,7 +869,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER, /* builder */ true); printer->Print(variables_, @@ -880,7 +880,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, /* builder */ true); printer->Print( @@ -894,7 +894,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field_lite.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field_lite.cc index 06ba0084a0..e94f70289b 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field_lite.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_field_lite.cc @@ -89,7 +89,7 @@ void SetEnumVariables(const FieldDescriptor* descriptor, int messageBitIndex, ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + " is deprecated\") " : ""; - (*variables)["required"] = descriptor->is_required() ? "true" : "false"; + (*variables)["required"] = descriptor->is_required() ? "true" : "false"; if (HasHasbit(descriptor)) { // For singular messages and builders, one bit is used for the hasField bit. @@ -176,7 +176,7 @@ void ImmutableEnumFieldLiteGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } if (SupportUnknownEnumValue(descriptor_->file())) { WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); @@ -186,7 +186,7 @@ void ImmutableEnumFieldLiteGenerator::GenerateMembers( "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" " return $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -195,7 +195,7 @@ void ImmutableEnumFieldLiteGenerator::GenerateMembers( " $type$ result = $type$.forNumber($name$_);\n" " return result == null ? $unknown$ : result;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Generate private setters for the builder to proxy into. if (SupportUnknownEnumValue(descriptor_->file())) { @@ -230,7 +230,7 @@ void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return instance.has$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } if (SupportUnknownEnumValue(descriptor_->file())) { WriteFieldEnumValueAccessorDocComment(printer, descriptor_, GETTER); @@ -240,7 +240,7 @@ void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" " return instance.get$capitalized_name$Value();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); printer->Print(variables_, @@ -250,7 +250,7 @@ void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$Value(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -258,7 +258,7 @@ void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return instance.get$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); printer->Print(variables_, @@ -268,7 +268,7 @@ void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -278,7 +278,7 @@ void ImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( " instance.clear$capitalized_name$();\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutableEnumFieldLiteGenerator::GenerateKotlinDslMembers( @@ -372,7 +372,7 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateMembers( " }\n" " return $default_number$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -385,7 +385,7 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateMembers( " }\n" " return $default$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Generate private setters for the builder to proxy into. if (SupportUnknownEnumValue(descriptor_->file())) { @@ -425,7 +425,7 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateFieldInfo( /*enforce_lite=*/context_->EnforceLite()); } } - + void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers( io::Printer* printer) const { GOOGLE_DCHECK(HasHazzer(descriptor_)); @@ -445,7 +445,7 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public int ${$get$capitalized_name$Value$}$() {\n" " return instance.get$capitalized_name$Value();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); printer->Print(variables_, @@ -455,7 +455,7 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$Value(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -463,7 +463,7 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return instance.get$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); printer->Print(variables_, @@ -473,7 +473,7 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -483,7 +483,7 @@ void ImmutableEnumOneofFieldLiteGenerator::GenerateBuilderMembers( " instance.clear$capitalized_name$();\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } // =================================================================== @@ -557,7 +557,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateMembers( " return new com.google.protobuf.Internal.ListAdapter<\n" " java.lang.Integer, $type$>($name$_, $name$_converter_);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, @@ -565,7 +565,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateMembers( "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return $name$_.size();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, @@ -573,7 +573,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" " return $name$_converter_.convert($name$_.getInt(index));\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); printer->Print(variables_, @@ -582,7 +582,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateMembers( "${$get$capitalized_name$ValueList$}$() {\n" " return $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, @@ -591,7 +591,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateMembers( "${$get$capitalized_name$Value$}$(int index) {\n" " return $name$_.getInt(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } if (!EnableExperimentalRuntimeForLite() && descriptor_->is_packed() && @@ -680,7 +680,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateFieldInfo( /*enforce_lite=*/context_->EnforceLite()); } } - + void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( io::Printer* printer) const { WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER); @@ -690,7 +690,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( "${$get$capitalized_name$List$}$() {\n" " return instance.get$capitalized_name$List();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, @@ -698,7 +698,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return instance.get$capitalized_name$Count();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, @@ -706,7 +706,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" " return instance.get$capitalized_name$(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, /* builder */ true); printer->Print(variables_, @@ -716,7 +716,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(index, value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, /* builder */ true); printer->Print(variables_, @@ -726,7 +726,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( " instance.add$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, /* builder */ true); printer->Print(variables_, @@ -736,7 +736,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( " instance.addAll$capitalized_name$(values);" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -746,7 +746,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( " instance.clear$capitalized_name$();\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_GETTER); @@ -757,7 +757,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( " return java.util.Collections.unmodifiableList(\n" " instance.get$capitalized_name$ValueList());\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, @@ -766,7 +766,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( "${$get$capitalized_name$Value$}$(int index) {\n" " return instance.get$capitalized_name$Value(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, /* builder */ true); @@ -778,7 +778,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$Value(index, value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_ADDER, /* builder */ true); printer->Print(variables_, @@ -787,7 +787,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( " instance.add$capitalized_name$Value(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldEnumValueAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, /* builder */ true); @@ -799,7 +799,7 @@ void RepeatedImmutableEnumFieldLiteGenerator::GenerateBuilderMembers( " instance.addAll$capitalized_name$Value(values);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_lite.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_lite.cc index bb2f6dc9c2..bf84607aac 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_lite.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_enum_lite.cc @@ -94,12 +94,12 @@ void EnumLiteGenerator::Generate(io::Printer* printer) { printer->Print("@java.lang.Deprecated\n"); } printer->Print(vars, "$name$($number$),\n"); - printer->Annotate("name", canonical_values_[i]); + printer->Annotate("name", canonical_values_[i]); } if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print("${$UNRECOGNIZED$}$(-1),\n", "{", "", "}", ""); - printer->Annotate("{", "}", descriptor_); + printer->Print("${$UNRECOGNIZED$}$(-1),\n", "{", "", "}", ""); + printer->Annotate("{", "}", descriptor_); } printer->Print( @@ -116,15 +116,15 @@ void EnumLiteGenerator::Generate(io::Printer* printer) { WriteEnumValueDocComment(printer, aliases_[i].value); printer->Print( vars, "public static final $classname$ $name$ = $canonical_name$;\n"); - printer->Annotate("name", aliases_[i].value); + printer->Annotate("name", aliases_[i].value); } for (int i = 0; i < descriptor_->value_count(); i++) { std::map<TProtoStringType, TProtoStringType> vars; vars["name"] = descriptor_->value(i)->name(); vars["number"] = StrCat(descriptor_->value(i)->number()); - vars["{"] = ""; - vars["}"] = ""; + vars["{"] = ""; + vars["}"] = ""; vars["deprecation"] = descriptor_->value(i)->options().deprecated() ? "@java.lang.Deprecated " : ""; @@ -132,40 +132,40 @@ void EnumLiteGenerator::Generate(io::Printer* printer) { printer->Print(vars, "$deprecation$public static final int ${$$name$_VALUE$}$ = " "$number$;\n"); - printer->Annotate("{", "}", descriptor_->value(i)); + printer->Annotate("{", "}", descriptor_->value(i)); } printer->Print("\n"); // ----------------------------------------------------------------- printer->Print( - "\n" + "\n" "@java.lang.Override\n" - "public final int getNumber() {\n"); - if (SupportUnknownEnumValue(descriptor_->file())) { - printer->Print( - " if (this == UNRECOGNIZED) {\n" - " throw new java.lang.IllegalArgumentException(\n" - " \"Can't get the number of an unknown enum value.\");\n" - " }\n"); - } - printer->Print( - " return value;\n" - "}\n" - "\n" - "/**\n" + "public final int getNumber() {\n"); + if (SupportUnknownEnumValue(descriptor_->file())) { + printer->Print( + " if (this == UNRECOGNIZED) {\n" + " throw new java.lang.IllegalArgumentException(\n" + " \"Can't get the number of an unknown enum value.\");\n" + " }\n"); + } + printer->Print( + " return value;\n" + "}\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" - "public static $classname$ valueOf(int value) {\n" - " return forNumber(value);\n" - "}\n" - "\n" - "public static $classname$ forNumber(int value) {\n" - " switch (value) {\n", - "classname", descriptor_->name()); + " * @deprecated Use {@link #forNumber(int)} instead.\n" + " */\n" + "@java.lang.Deprecated\n" + "public static $classname$ valueOf(int value) {\n" + " return forNumber(value);\n" + "}\n" + "\n" + "public static $classname$ forNumber(int value) {\n" + " switch (value) {\n", + "classname", descriptor_->name()); printer->Indent(); printer->Indent(); diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_extension.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_extension.cc index 04486b3ee3..9602780c49 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_extension.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_extension.cc @@ -60,7 +60,7 @@ ImmutableExtensionGenerator::ImmutableExtensionGenerator( ImmutableExtensionGenerator::~ImmutableExtensionGenerator() {} // Initializes the vars referenced in the generated code templates. -void ExtensionGenerator::InitTemplateVars( +void ExtensionGenerator::InitTemplateVars( const FieldDescriptor* descriptor, const TProtoStringType& scope, bool immutable, ClassNameResolver* name_resolver, std::map<TProtoStringType, TProtoStringType>* vars_pointer) { @@ -76,7 +76,7 @@ void ExtensionGenerator::InitTemplateVars( ? "" : DefaultValue(descriptor, immutable, name_resolver); vars["type_constant"] = FieldTypeName(GetType(descriptor)); - vars["packed"] = descriptor->is_packed() ? "true" : "false"; + vars["packed"] = descriptor->is_packed() ? "true" : "false"; vars["enum_map"] = "null"; vars["prototype"] = "null"; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_field.cc index 3a0bc21722..15283e1083 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_field.cc @@ -73,8 +73,8 @@ ImmutableFieldGenerator* MakeImmutableGenerator(const FieldDescriptor* field, return new ImmutableMapFieldGenerator(field, messageBitIndex, builderBitIndex, context); } else { - return new RepeatedImmutableMessageFieldGenerator( - field, messageBitIndex, builderBitIndex, context); + return new RepeatedImmutableMessageFieldGenerator( + field, messageBitIndex, builderBitIndex, context); } case JAVATYPE_ENUM: return new RepeatedImmutableEnumFieldGenerator( @@ -90,8 +90,8 @@ ImmutableFieldGenerator* MakeImmutableGenerator(const FieldDescriptor* field, if (IsRealOneof(field)) { switch (GetJavaType(field)) { case JAVATYPE_MESSAGE: - return new ImmutableMessageOneofFieldGenerator( - field, messageBitIndex, builderBitIndex, context); + return new ImmutableMessageOneofFieldGenerator( + field, messageBitIndex, builderBitIndex, context); case JAVATYPE_ENUM: return new ImmutableEnumOneofFieldGenerator(field, messageBitIndex, builderBitIndex, context); @@ -130,7 +130,7 @@ ImmutableFieldLiteGenerator* MakeImmutableLiteGenerator( return new ImmutableMapFieldLiteGenerator(field, messageBitIndex, context); } else { - return new RepeatedImmutableMessageFieldLiteGenerator( + return new RepeatedImmutableMessageFieldLiteGenerator( field, messageBitIndex, context); } case JAVATYPE_ENUM: @@ -147,7 +147,7 @@ ImmutableFieldLiteGenerator* MakeImmutableLiteGenerator( if (IsRealOneof(field)) { switch (GetJavaType(field)) { case JAVATYPE_MESSAGE: - return new ImmutableMessageOneofFieldLiteGenerator( + return new ImmutableMessageOneofFieldLiteGenerator( field, messageBitIndex, context); case JAVATYPE_ENUM: return new ImmutableEnumOneofFieldLiteGenerator( @@ -246,18 +246,18 @@ void SetCommonFieldVariables(const FieldDescriptor* descriptor, std::map<TProtoStringType, TProtoStringType>* variables) { (*variables)["field_name"] = descriptor->name(); (*variables)["name"] = info->name; - (*variables)["classname"] = descriptor->containing_type()->name(); + (*variables)["classname"] = descriptor->containing_type()->name(); (*variables)["capitalized_name"] = info->capitalized_name; (*variables)["disambiguated_reason"] = info->disambiguated_reason; (*variables)["constant_name"] = FieldConstantName(descriptor); (*variables)["number"] = StrCat(descriptor->number()); (*variables)["kt_dsl_builder"] = "_builder"; - // These variables are placeholders to pick out the beginning and ends of - // identifiers for annotations (when doing so with existing variables would - // be ambiguous or impossible). They should never be set to anything but the - // empty string. - (*variables)["{"] = ""; - (*variables)["}"] = ""; + // These variables are placeholders to pick out the beginning and ends of + // identifiers for annotations (when doing so with existing variables would + // be ambiguous or impossible). They should never be set to anything but the + // empty string. + (*variables)["{"] = ""; + (*variables)["}"] = ""; (*variables)["kt_name"] = IsForbiddenKotlin(info->name) ? info->name + "_" : info->name; (*variables)["kt_capitalized_name"] = IsForbiddenKotlin(info->name) diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_field.h b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_field.h index 947be7fb1a..09384c483a 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_field.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_field.h @@ -163,7 +163,7 @@ struct FieldGeneratorInfo { TProtoStringType disambiguated_reason; }; -// Oneof information used in OneofFieldGenerators. +// Oneof information used in OneofFieldGenerators. struct OneofGeneratorInfo { TProtoStringType name; TProtoStringType capitalized_name; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_file.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_file.cc index a93754b908..0809febb8b 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_file.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_file.cc @@ -519,57 +519,57 @@ void FileGenerator::GenerateDescriptorInitializationCodeForMutable( // Try to load immutable messages' outer class. Its initialization code // will take care of interpreting custom options. printer->Print( - "try {\n" - // Note that we have to load the immutable class dynamically here as - // we want the mutable code to be independent from the immutable code - // at compile time. It is required to implement dual-compile for - // mutable and immutable API in blaze. + "try {\n" + // Note that we have to load the immutable class dynamically here as + // we want the mutable code to be independent from the immutable code + // at compile time. It is required to implement dual-compile for + // mutable and immutable API in blaze. " java.lang.Class<?> immutableClass = java.lang.Class.forName(\n" - " \"$immutable_classname$\");\n" - "} catch (java.lang.ClassNotFoundException e) {\n", - "immutable_classname", name_resolver_->GetImmutableClassName(file_)); - printer->Indent(); - - // The immutable class can not be found. We try our best to collect all - // custom option extensions to interpret the custom options. - printer->Print( - "com.google.protobuf.ExtensionRegistry registry =\n" - " com.google.protobuf.ExtensionRegistry.newInstance();\n" - "com.google.protobuf.MessageLite defaultExtensionInstance = null;\n"); - FieldDescriptorSet::iterator it; - for (it = extensions.begin(); it != extensions.end(); it++) { - const FieldDescriptor* field = *it; + " \"$immutable_classname$\");\n" + "} catch (java.lang.ClassNotFoundException e) {\n", + "immutable_classname", name_resolver_->GetImmutableClassName(file_)); + printer->Indent(); + + // The immutable class can not be found. We try our best to collect all + // custom option extensions to interpret the custom options. + printer->Print( + "com.google.protobuf.ExtensionRegistry registry =\n" + " com.google.protobuf.ExtensionRegistry.newInstance();\n" + "com.google.protobuf.MessageLite defaultExtensionInstance = null;\n"); + FieldDescriptorSet::iterator it; + for (it = extensions.begin(); it != extensions.end(); it++) { + const FieldDescriptor* field = *it; TProtoStringType scope; - if (field->extension_scope() != NULL) { - scope = name_resolver_->GetMutableClassName(field->extension_scope()) + - ".getDescriptor()"; - } else { - scope = FileJavaPackage(field->file(), true) + "." + - name_resolver_->GetDescriptorClassName(field->file()) + - ".descriptor"; - } - if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { - printer->Print( - "defaultExtensionInstance = com.google.protobuf.Internal\n" - " .getDefaultInstance(\"$class$\");\n" - "if (defaultExtensionInstance != null) {\n" - " registry.add(\n" - " $scope$.getExtensions().get($index$),\n" - " (com.google.protobuf.Message) defaultExtensionInstance);\n" - "}\n", + if (field->extension_scope() != NULL) { + scope = name_resolver_->GetMutableClassName(field->extension_scope()) + + ".getDescriptor()"; + } else { + scope = FileJavaPackage(field->file(), true) + "." + + name_resolver_->GetDescriptorClassName(field->file()) + + ".descriptor"; + } + if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { + printer->Print( + "defaultExtensionInstance = com.google.protobuf.Internal\n" + " .getDefaultInstance(\"$class$\");\n" + "if (defaultExtensionInstance != null) {\n" + " registry.add(\n" + " $scope$.getExtensions().get($index$),\n" + " (com.google.protobuf.Message) defaultExtensionInstance);\n" + "}\n", "scope", scope, "index", StrCat(field->index()), "class", - name_resolver_->GetImmutableClassName(field->message_type())); - } else { - printer->Print("registry.add($scope$.getExtensions().get($index$));\n", + name_resolver_->GetImmutableClassName(field->message_type())); + } else { + printer->Print("registry.add($scope$.getExtensions().get($index$));\n", "scope", scope, "index", StrCat(field->index())); - } - } - printer->Print( - "com.google.protobuf.Descriptors.FileDescriptor\n" - " .internalUpdateFileDescriptor(descriptor, registry);\n"); - - printer->Outdent(); - printer->Print("}\n"); + } + } + printer->Print( + "com.google.protobuf.Descriptors.FileDescriptor\n" + " .internalUpdateFileDescriptor(descriptor, registry);\n"); + + printer->Outdent(); + printer->Print("}\n"); } // Force descriptor initialization of all dependencies. diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_generator.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_generator.cc index ff428c166e..2b5728579e 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_generator.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_generator.cc @@ -46,7 +46,7 @@ #include <google/protobuf/descriptor.pb.h> #include <google/protobuf/io/printer.h> #include <google/protobuf/io/zero_copy_stream.h> - + #include <google/protobuf/stubs/strutil.h> namespace google { diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.cc index 81b5a3f220..a498388ade 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.cc @@ -271,12 +271,12 @@ TProtoStringType UniqueFileScopeIdentifier(const Descriptor* descriptor) { TProtoStringType CamelCaseFieldName(const FieldDescriptor* field) { TProtoStringType fieldName = UnderscoresToCamelCase(field); - if ('0' <= fieldName[0] && fieldName[0] <= '9') { + if ('0' <= fieldName[0] && fieldName[0] <= '9') { return '_' + fieldName; - } - return fieldName; -} - + } + return fieldName; +} + TProtoStringType FileClassName(const FileDescriptor* file, bool immutable) { ClassNameResolver name_resolver; return name_resolver.GetFileClassName(file, immutable); @@ -328,7 +328,7 @@ TProtoStringType ClassName(const FileDescriptor* descriptor) { return name_resolver.GetClassName(descriptor, true); } - + TProtoStringType ExtraMessageInterfaces(const Descriptor* descriptor) { TProtoStringType interfaces = "// @@protoc_insertion_point(message_implements:" + descriptor->full_name() + ")"; @@ -469,7 +469,7 @@ const char* BoxedPrimitiveTypeName(JavaType type) { const char* BoxedPrimitiveTypeName(const FieldDescriptor* descriptor) { return BoxedPrimitiveTypeName(GetJavaType(descriptor)); } - + const char* KotlinTypeName(JavaType type) { switch (type) { case JAVATYPE_INT: diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.h b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.h index 1520bbadb7..5acc729c1d 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_helpers.h @@ -98,9 +98,9 @@ TProtoStringType UnderscoresToCamelCase(const MethodDescriptor* method); TProtoStringType UnderscoresToCamelCaseCheckReserved(const FieldDescriptor* field); // Similar to UnderscoresToCamelCase, but guarantees that the result is a -// complete Java identifier by adding a _ if needed. +// complete Java identifier by adding a _ if needed. TProtoStringType CamelCaseFieldName(const FieldDescriptor* field); - + // Get an identifier that uniquely identifies this type within the file. // This is used to declare static variables related to this type at the // outermost file scope. diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_map_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_map_field.cc index 6d7580cf79..353bff46db 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_map_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_map_field.cc @@ -101,12 +101,12 @@ void SetMessageVariables(const FieldDescriptor* descriptor, int messageBitIndex, (*variables)["key_type"] = TypeName(key, name_resolver, false); TProtoStringType boxed_key_type = TypeName(key, name_resolver, true); - (*variables)["boxed_key_type"] = boxed_key_type; + (*variables)["boxed_key_type"] = boxed_key_type; (*variables)["kt_key_type"] = KotlinTypeName(key, name_resolver); (*variables)["kt_value_type"] = KotlinTypeName(value, name_resolver); - // Used for calling the serialization function. - (*variables)["short_key_type"] = - boxed_key_type.substr(boxed_key_type.rfind('.') + 1); + // Used for calling the serialization function. + (*variables)["short_key_type"] = + boxed_key_type.substr(boxed_key_type.rfind('.') + 1); (*variables)["key_wire_type"] = WireType(key); (*variables)["key_default_value"] = DefaultValue(key, true, name_resolver); (*variables)["key_null_check"] = @@ -169,7 +169,7 @@ void SetMessageVariables(const FieldDescriptor* descriptor, int messageBitIndex, (*variables)["descriptor"] = name_resolver->GetImmutableClassName(descriptor->file()) + ".internal_" + UniqueFileScopeIdentifier(descriptor->message_type()) + "_descriptor, "; - (*variables)["ver"] = GeneratedCodeVersionSuffix(); + (*variables)["ver"] = GeneratedCodeVersionSuffix(); } } // namespace @@ -194,12 +194,12 @@ void ImmutableMapFieldGenerator::GenerateInterfaceMembers( WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$int ${$get$capitalized_name$Count$}$();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$boolean ${$contains$capitalized_name$$}$(\n" " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { printer->Print(variables_, "/**\n" @@ -208,26 +208,26 @@ void ImmutableMapFieldGenerator::GenerateInterfaceMembers( "@java.lang.Deprecated\n" "java.util.Map<$boxed_key_type$, $value_enum_type$>\n" "${$get$capitalized_name$$}$();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "$deprecation$java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$Map$}$();\n"); - printer->Annotate("{", "}", descriptor_); + "${$get$capitalized_name$Map$}$();\n"); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, - "$deprecation$$value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" + "$deprecation$$value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" " $key_type$ key,\n" " $value_enum_type$ defaultValue);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, - "$deprecation$$value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" + "$deprecation$$value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { printer->Print( variables_, @@ -236,26 +236,26 @@ void ImmutableMapFieldGenerator::GenerateInterfaceMembers( " */\n" "@java.lang.Deprecated\n" "java.util.Map<$type_parameters$>\n" - "${$get$capitalized_name$Value$}$();\n"); - printer->Annotate("{", "}", descriptor_); + "${$get$capitalized_name$Value$}$();\n"); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$java.util.Map<$type_parameters$>\n" "${$get$capitalized_name$ValueMap$}$();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$\n" "$value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" " $key_type$ key,\n" " $value_type$ defaultValue);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$\n" "$value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } else { printer->Print(variables_, @@ -265,25 +265,25 @@ void ImmutableMapFieldGenerator::GenerateInterfaceMembers( "@java.lang.Deprecated\n" "java.util.Map<$type_parameters$>\n" "${$get$capitalized_name$$}$();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$java.util.Map<$type_parameters$>\n" "${$get$capitalized_name$Map$}$();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$\n" "$value_type$ ${$get$capitalized_name$OrDefault$}$(\n" " $key_type$ key,\n" " $value_type$ defaultValue);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$\n" "$value_type$ ${$get$capitalized_name$OrThrow$}$(\n" " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } @@ -321,16 +321,16 @@ void ImmutableMapFieldGenerator::GenerateMembers(io::Printer* printer) const { " com.google.protobuf.Internal.MapAdapter.newEnumConverter(\n" " $value_enum_type$.internalGetValueMap(),\n" " $unrecognized_value$);\n"); - printer->Print( - variables_, - "private static final java.util.Map<$boxed_key_type$, " - "$value_enum_type$>\n" - "internalGetAdapted$capitalized_name$Map(\n" - " java.util.Map<$boxed_key_type$, $boxed_value_type$> map) {\n" - " return new com.google.protobuf.Internal.MapAdapter<\n" - " $boxed_key_type$, $value_enum_type$, java.lang.Integer>(\n" - " map, $name$ValueConverter);\n" - "}\n"); + printer->Print( + variables_, + "private static final java.util.Map<$boxed_key_type$, " + "$value_enum_type$>\n" + "internalGetAdapted$capitalized_name$Map(\n" + " java.util.Map<$boxed_key_type$, $boxed_value_type$> map) {\n" + " return new com.google.protobuf.Internal.MapAdapter<\n" + " $boxed_key_type$, $value_enum_type$, java.lang.Integer>(\n" + " map, $name$ValueConverter);\n" + "}\n"); } GenerateMapGetters(printer); } @@ -368,7 +368,7 @@ void ImmutableMapFieldGenerator::GenerateBuilderMembers( " .clear();\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$\n" @@ -379,7 +379,7 @@ void ImmutableMapFieldGenerator::GenerateBuilderMembers( " .remove(key);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { printer->Print( variables_, @@ -388,34 +388,34 @@ void ImmutableMapFieldGenerator::GenerateBuilderMembers( " */\n" "@java.lang.Deprecated\n" "public java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$getMutable$capitalized_name$$}$() {\n" - " return internalGetAdapted$capitalized_name$Map(\n" - " internalGetMutable$capitalized_name$().getMutableMap());\n" + "${$getMutable$capitalized_name$$}$() {\n" + " return internalGetAdapted$capitalized_name$Map(\n" + " internalGetMutable$capitalized_name$().getMutableMap());\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, - "$deprecation$public Builder ${$put$capitalized_name$$}$(\n" - " $key_type$ key,\n" - " $value_enum_type$ value) {\n" - " $key_null_check$\n" - " $value_null_check$\n" - " internalGetMutable$capitalized_name$().getMutableMap()\n" - " .put(key, $name$ValueConverter.doBackward(value));\n" - " return this;\n" - "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Print(variables_, + "$deprecation$public Builder ${$put$capitalized_name$$}$(\n" + " $key_type$ key,\n" + " $value_enum_type$ value) {\n" + " $key_null_check$\n" + " $value_null_check$\n" + " internalGetMutable$capitalized_name$().getMutableMap()\n" + " .put(key, $name$ValueConverter.doBackward(value));\n" + " return this;\n" + "}\n"); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, - "$deprecation$public Builder ${$putAll$capitalized_name$$}$(\n" + "$deprecation$public Builder ${$putAll$capitalized_name$$}$(\n" " java.util.Map<$boxed_key_type$, $value_enum_type$> values) {\n" - " internalGetAdapted$capitalized_name$Map(\n" - " internalGetMutable$capitalized_name$().getMutableMap())\n" - " .putAll(values);\n" + " internalGetAdapted$capitalized_name$Map(\n" + " internalGetMutable$capitalized_name$().getMutableMap())\n" + " .putAll(values);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { printer->Print( variables_, @@ -424,32 +424,32 @@ void ImmutableMapFieldGenerator::GenerateBuilderMembers( " */\n" "@java.lang.Deprecated\n" "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$getMutable$capitalized_name$Value$}$() {\n" + "${$getMutable$capitalized_name$Value$}$() {\n" " return internalGetMutable$capitalized_name$().getMutableMap();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, - "$deprecation$public Builder ${$put$capitalized_name$Value$}$(\n" + "$deprecation$public Builder ${$put$capitalized_name$Value$}$(\n" " $key_type$ key,\n" " $value_type$ value) {\n" " $key_null_check$\n" - " internalGetMutable$capitalized_name$().getMutableMap()\n" - " .put(key, value);\n" + " internalGetMutable$capitalized_name$().getMutableMap()\n" + " .put(key, value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, - "$deprecation$public Builder ${$putAll$capitalized_name$Value$}$(\n" + "$deprecation$public Builder ${$putAll$capitalized_name$Value$}$(\n" " java.util.Map<$boxed_key_type$, $boxed_value_type$> values) {\n" - " internalGetMutable$capitalized_name$().getMutableMap()\n" - " .putAll(values);\n" + " internalGetMutable$capitalized_name$().getMutableMap()\n" + " .putAll(values);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } else { printer->Print( @@ -459,10 +459,10 @@ void ImmutableMapFieldGenerator::GenerateBuilderMembers( " */\n" "@java.lang.Deprecated\n" "public java.util.Map<$type_parameters$>\n" - "${$getMutable$capitalized_name$$}$() {\n" + "${$getMutable$capitalized_name$$}$() {\n" " return internalGetMutable$capitalized_name$().getMutableMap();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$" @@ -475,7 +475,7 @@ void ImmutableMapFieldGenerator::GenerateBuilderMembers( " .put(key, value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$\n" @@ -485,7 +485,7 @@ void ImmutableMapFieldGenerator::GenerateBuilderMembers( " .putAll(values);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } @@ -496,18 +496,18 @@ void ImmutableMapFieldGenerator::GenerateMapGetters( "public int ${$get$capitalized_name$Count$}$() {\n" " return internalGet$capitalized_name$().getMap().size();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "$deprecation$\n" "@java.lang.Override\n" - "public boolean ${$contains$capitalized_name$$}$(\n" + "public boolean ${$contains$capitalized_name$$}$(\n" " $key_type$ key) {\n" " $key_null_check$\n" " return internalGet$capitalized_name$().getMap().containsKey(key);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { printer->Print(variables_, "/**\n" @@ -519,7 +519,7 @@ void ImmutableMapFieldGenerator::GenerateMapGetters( "${$get$capitalized_name$$}$() {\n" " return get$capitalized_name$Map();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "@java.lang.Override\n" @@ -529,13 +529,13 @@ void ImmutableMapFieldGenerator::GenerateMapGetters( " return internalGetAdapted$capitalized_name$Map(\n" " internalGet$capitalized_name$().getMap());" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" + "public $value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" " $key_type$ key,\n" " $value_enum_type$ defaultValue) {\n" " $key_null_check$\n" @@ -545,13 +545,13 @@ void ImmutableMapFieldGenerator::GenerateMapGetters( " ? $name$ValueConverter.doForward(map.get(key))\n" " : defaultValue;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" + "public $value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" " $key_type$ key) {\n" " $key_null_check$\n" " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" @@ -561,7 +561,7 @@ void ImmutableMapFieldGenerator::GenerateMapGetters( " }\n" " return $name$ValueConverter.doForward(map.get(key));\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { printer->Print( variables_, @@ -571,26 +571,26 @@ void ImmutableMapFieldGenerator::GenerateMapGetters( "@java.lang.Override\n" "@java.lang.Deprecated\n" "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$get$capitalized_name$Value$}$() {\n" + "${$get$capitalized_name$Value$}$() {\n" " return get$capitalized_name$ValueMap();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$get$capitalized_name$ValueMap$}$() {\n" + "${$get$capitalized_name$ValueMap$}$() {\n" " return internalGet$capitalized_name$().getMap();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" + "public $value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" " $key_type$ key,\n" " $value_type$ defaultValue) {\n" " $key_null_check$\n" @@ -598,13 +598,13 @@ void ImmutableMapFieldGenerator::GenerateMapGetters( " internalGet$capitalized_name$().getMap();\n" " return map.containsKey(key) ? map.get(key) : defaultValue;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" + "public $value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" " $key_type$ key) {\n" " $key_null_check$\n" " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" @@ -614,7 +614,7 @@ void ImmutableMapFieldGenerator::GenerateMapGetters( " }\n" " return map.get(key);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } else { printer->Print(variables_, @@ -627,7 +627,7 @@ void ImmutableMapFieldGenerator::GenerateMapGetters( "${$get$capitalized_name$$}$() {\n" " return get$capitalized_name$Map();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "@java.lang.Override\n" @@ -636,13 +636,13 @@ void ImmutableMapFieldGenerator::GenerateMapGetters( "${$get$capitalized_name$Map$}$() {\n" " return internalGet$capitalized_name$().getMap();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$OrDefault$}$(\n" + "public $value_type$ ${$get$capitalized_name$OrDefault$}$(\n" " $key_type$ key,\n" " $value_type$ defaultValue) {\n" " $key_null_check$\n" @@ -650,7 +650,7 @@ void ImmutableMapFieldGenerator::GenerateMapGetters( " internalGet$capitalized_name$().getMap();\n" " return map.containsKey(key) ? map.get(key) : defaultValue;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "@java.lang.Override\n" @@ -665,7 +665,7 @@ void ImmutableMapFieldGenerator::GenerateMapGetters( " }\n" " return map.get(key);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } @@ -794,23 +794,23 @@ void ImmutableMapFieldGenerator::GenerateParsingCode( variables_, "com.google.protobuf.ByteString bytes = input.readBytes();\n" "com.google.protobuf.MapEntry<$type_parameters$>\n" - "$name$__ = $default_entry$.getParserForType().parseFrom(bytes);\n"); + "$name$__ = $default_entry$.getParserForType().parseFrom(bytes);\n"); printer->Print( variables_, - "if ($value_enum_type$.forNumber($name$__.getValue()) == null) {\n" + "if ($value_enum_type$.forNumber($name$__.getValue()) == null) {\n" " unknownFields.mergeLengthDelimitedField($number$, bytes);\n" "} else {\n" - " $name$_.getMutableMap().put(\n" - " $name$__.getKey(), $name$__.getValue());\n" + " $name$_.getMutableMap().put(\n" + " $name$__.getKey(), $name$__.getValue());\n" "}\n"); } else { printer->Print( variables_, "com.google.protobuf.MapEntry<$type_parameters$>\n" - "$name$__ = input.readMessage(\n" + "$name$__ = input.readMessage(\n" " $default_entry$.getParserForType(), extensionRegistry);\n" - "$name$_.getMutableMap().put(\n" - " $name$__.getKey(), $name$__.getValue());\n"); + "$name$_.getMutableMap().put(\n" + " $name$__.getKey(), $name$__.getValue());\n"); } } @@ -837,12 +837,12 @@ void ImmutableMapFieldGenerator::GenerateSerializedSizeCode( "for (java.util.Map.Entry<$type_parameters$> entry\n" " : internalGet$capitalized_name$().getMap().entrySet()) {\n" " com.google.protobuf.MapEntry<$type_parameters$>\n" - " $name$__ = $default_entry$.newBuilderForType()\n" + " $name$__ = $default_entry$.newBuilderForType()\n" " .setKey(entry.getKey())\n" " .setValue(entry.getValue())\n" " .build();\n" " size += com.google.protobuf.CodedOutputStream\n" - " .computeMessageSize($number$, $name$__);\n" + " .computeMessageSize($number$, $name$__);\n" "}\n"); } diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_map_field_lite.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_map_field_lite.cc index 716c910954..79bd924701 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_map_field_lite.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_map_field_lite.cc @@ -181,12 +181,12 @@ void ImmutableMapFieldLiteGenerator::GenerateInterfaceMembers( WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$int ${$get$capitalized_name$Count$}$();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$boolean ${$contains$capitalized_name$$}$(\n" " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { printer->Print(variables_, "/**\n" @@ -195,26 +195,26 @@ void ImmutableMapFieldLiteGenerator::GenerateInterfaceMembers( "@java.lang.Deprecated\n" "java.util.Map<$boxed_key_type$, $value_enum_type$>\n" "${$get$capitalized_name$$}$();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "$deprecation$java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$Map$}$();\n"); - printer->Annotate("{", "}", descriptor_); + "${$get$capitalized_name$Map$}$();\n"); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, - "$deprecation$$value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" + "$deprecation$$value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" " $key_type$ key,\n" " $value_enum_type$ defaultValue);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, - "$deprecation$$value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" + "$deprecation$$value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { printer->Print( variables_, @@ -223,26 +223,26 @@ void ImmutableMapFieldLiteGenerator::GenerateInterfaceMembers( " */\n" "@java.lang.Deprecated\n" "java.util.Map<$type_parameters$>\n" - "${$get$capitalized_name$Value$}$();\n"); - printer->Annotate("{", "}", descriptor_); + "${$get$capitalized_name$Value$}$();\n"); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$java.util.Map<$type_parameters$>\n" "${$get$capitalized_name$ValueMap$}$();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$\n" "$value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" " $key_type$ key,\n" " $value_type$ defaultValue);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$\n" "$value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } else { printer->Print(variables_, @@ -252,25 +252,25 @@ void ImmutableMapFieldLiteGenerator::GenerateInterfaceMembers( "@java.lang.Deprecated\n" "java.util.Map<$type_parameters$>\n" "${$get$capitalized_name$$}$();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$java.util.Map<$type_parameters$>\n" "${$get$capitalized_name$Map$}$();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$\n" "$value_type$ ${$get$capitalized_name$OrDefault$}$(\n" " $key_type$ key,\n" " $value_type$ defaultValue);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$\n" "$value_type$ ${$get$capitalized_name$OrThrow$}$(\n" " $key_type$ key);\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } @@ -309,7 +309,7 @@ void ImmutableMapFieldLiteGenerator::GenerateMembers( "public int ${$get$capitalized_name$Count$}$() {\n" " return internalGet$capitalized_name$().size();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "@java.lang.Override\n" @@ -319,7 +319,7 @@ void ImmutableMapFieldLiteGenerator::GenerateMembers( " $key_null_check$\n" " return internalGet$capitalized_name$().containsKey(key);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { printer->Print( variables_, @@ -338,27 +338,27 @@ void ImmutableMapFieldLiteGenerator::GenerateMembers( "${$get$capitalized_name$$}$() {\n" " return get$capitalized_name$Map();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" "public java.util.Map<$boxed_key_type$, $value_enum_type$>\n" - "${$get$capitalized_name$Map$}$() {\n" + "${$get$capitalized_name$Map$}$() {\n" " return java.util.Collections.unmodifiableMap(\n" " new com.google.protobuf.Internal.MapAdapter<\n" " $boxed_key_type$, $value_enum_type$, java.lang.Integer>(\n" " internalGet$capitalized_name$(),\n" " $name$ValueConverter));\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" + "public $value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" " $key_type$ key,\n" " $value_enum_type$ defaultValue) {\n" " $key_null_check$\n" @@ -368,13 +368,13 @@ void ImmutableMapFieldLiteGenerator::GenerateMembers( " ? $name$ValueConverter.doForward(map.get(key))\n" " : defaultValue;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" + "public $value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" " $key_type$ key) {\n" " $key_null_check$\n" " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" @@ -384,7 +384,7 @@ void ImmutableMapFieldLiteGenerator::GenerateMembers( " }\n" " return $name$ValueConverter.doForward(map.get(key));\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { printer->Print( variables_, @@ -394,27 +394,27 @@ void ImmutableMapFieldLiteGenerator::GenerateMembers( "@java.lang.Override\n" "@java.lang.Deprecated\n" "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$get$capitalized_name$Value$}$() {\n" + "${$get$capitalized_name$Value$}$() {\n" " return get$capitalized_name$ValueMap();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$get$capitalized_name$ValueMap$}$() {\n" + "${$get$capitalized_name$ValueMap$}$() {\n" " return java.util.Collections.unmodifiableMap(\n" " internalGet$capitalized_name$());\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" + "public $value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" " $key_type$ key,\n" " $value_type$ defaultValue) {\n" " $key_null_check$\n" @@ -422,13 +422,13 @@ void ImmutableMapFieldLiteGenerator::GenerateMembers( " internalGet$capitalized_name$();\n" " return map.containsKey(key) ? map.get(key) : defaultValue;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" + "public $value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" " $key_type$ key) {\n" " $key_null_check$\n" " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" @@ -438,7 +438,7 @@ void ImmutableMapFieldLiteGenerator::GenerateMembers( " }\n" " return map.get(key);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } else { printer->Print(variables_, @@ -451,7 +451,7 @@ void ImmutableMapFieldLiteGenerator::GenerateMembers( "${$get$capitalized_name$$}$() {\n" " return get$capitalized_name$Map();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "@java.lang.Override\n" @@ -461,13 +461,13 @@ void ImmutableMapFieldLiteGenerator::GenerateMembers( " return java.util.Collections.unmodifiableMap(\n" " internalGet$capitalized_name$());\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$OrDefault$}$(\n" + "public $value_type$ ${$get$capitalized_name$OrDefault$}$(\n" " $key_type$ key,\n" " $value_type$ defaultValue) {\n" " $key_null_check$\n" @@ -475,7 +475,7 @@ void ImmutableMapFieldLiteGenerator::GenerateMembers( " internalGet$capitalized_name$();\n" " return map.containsKey(key) ? map.get(key) : defaultValue;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "@java.lang.Override\n" @@ -490,7 +490,7 @@ void ImmutableMapFieldLiteGenerator::GenerateMembers( " }\n" " return map.get(key);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } // Generate private setters for the builder to proxy into. @@ -540,7 +540,7 @@ void ImmutableMapFieldLiteGenerator::GenerateFieldInfo( /*enforce_lite=*/context_->EnforceLite()); } } - + void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( io::Printer* printer) const { printer->Print(variables_, @@ -549,18 +549,18 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( "public int ${$get$capitalized_name$Count$}$() {\n" " return instance.get$capitalized_name$Map().size();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public boolean ${$contains$capitalized_name$$}$(\n" + "public boolean ${$contains$capitalized_name$$}$(\n" " $key_type$ key) {\n" " $key_null_check$\n" " return instance.get$capitalized_name$Map().containsKey(key);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); printer->Print(variables_, "$deprecation$\n" "public Builder ${$clear$capitalized_name$$}$() {\n" @@ -568,7 +568,7 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " instance.getMutable$capitalized_name$Map().clear();\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$\n" @@ -579,7 +579,7 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " instance.getMutable$capitalized_name$Map().remove(key);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (GetJavaType(ValueField(descriptor_)) == JAVATYPE_ENUM) { printer->Print(variables_, "/**\n" @@ -590,7 +590,7 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( "${$get$capitalized_name$$}$() {\n" " return get$capitalized_name$Map();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "@java.lang.Override\n" @@ -600,13 +600,13 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " return java.util.Collections.unmodifiableMap(\n" " instance.get$capitalized_name$Map());\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" + "public $value_enum_type$ ${$get$capitalized_name$OrDefault$}$(\n" " $key_type$ key,\n" " $value_enum_type$ defaultValue) {\n" " $key_null_check$\n" @@ -616,13 +616,13 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " ? map.get(key)\n" " : defaultValue;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" + "public $value_enum_type$ ${$get$capitalized_name$OrThrow$}$(\n" " $key_type$ key) {\n" " $key_null_check$\n" " java.util.Map<$boxed_key_type$, $value_enum_type$> map =\n" @@ -632,11 +632,11 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " }\n" " return map.get(key);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, - "$deprecation$public Builder ${$put$capitalized_name$$}$(\n" + "$deprecation$public Builder ${$put$capitalized_name$$}$(\n" " $key_type$ key,\n" " $value_enum_type$ value) {\n" " $key_null_check$\n" @@ -645,17 +645,17 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " instance.getMutable$capitalized_name$Map().put(key, value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, - "$deprecation$public Builder ${$putAll$capitalized_name$$}$(\n" + "$deprecation$public Builder ${$putAll$capitalized_name$$}$(\n" " java.util.Map<$boxed_key_type$, $value_enum_type$> values) {\n" " copyOnWrite();\n" " instance.getMutable$capitalized_name$Map().putAll(values);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (SupportUnknownEnumValue(descriptor_->file())) { printer->Print( variables_, @@ -665,27 +665,27 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( "@java.lang.Override\n" "@java.lang.Deprecated\n" "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$get$capitalized_name$Value$}$() {\n" + "${$get$capitalized_name$Value$}$() {\n" " return get$capitalized_name$ValueMap();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" "public java.util.Map<$boxed_key_type$, $boxed_value_type$>\n" - "${$get$capitalized_name$ValueMap$}$() {\n" + "${$get$capitalized_name$ValueMap$}$() {\n" " return java.util.Collections.unmodifiableMap(\n" " instance.get$capitalized_name$ValueMap());\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" + "public $value_type$ ${$get$capitalized_name$ValueOrDefault$}$(\n" " $key_type$ key,\n" " $value_type$ defaultValue) {\n" " $key_null_check$\n" @@ -693,13 +693,13 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " instance.get$capitalized_name$ValueMap();\n" " return map.containsKey(key) ? map.get(key) : defaultValue;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" + "public $value_type$ ${$get$capitalized_name$ValueOrThrow$}$(\n" " $key_type$ key) {\n" " $key_null_check$\n" " java.util.Map<$boxed_key_type$, $boxed_value_type$> map =\n" @@ -709,11 +709,11 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " }\n" " return map.get(key);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, - "$deprecation$public Builder ${$put$capitalized_name$Value$}$(\n" + "$deprecation$public Builder ${$put$capitalized_name$Value$}$(\n" " $key_type$ key,\n" " $value_type$ value) {\n" " $key_null_check$\n" @@ -721,17 +721,17 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " instance.getMutable$capitalized_name$ValueMap().put(key, value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, - "$deprecation$public Builder ${$putAll$capitalized_name$Value$}$(\n" + "$deprecation$public Builder ${$putAll$capitalized_name$Value$}$(\n" " java.util.Map<$boxed_key_type$, $boxed_value_type$> values) {\n" " copyOnWrite();\n" " instance.getMutable$capitalized_name$ValueMap().putAll(values);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } else { printer->Print(variables_, @@ -744,7 +744,7 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( "${$get$capitalized_name$$}$() {\n" " return get$capitalized_name$Map();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "@java.lang.Override\n" @@ -754,13 +754,13 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " return java.util.Collections.unmodifiableMap(\n" " instance.get$capitalized_name$Map());\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "@java.lang.Override\n" "$deprecation$\n" - "public $value_type$ ${$get$capitalized_name$OrDefault$}$(\n" + "public $value_type$ ${$get$capitalized_name$OrDefault$}$(\n" " $key_type$ key,\n" " $value_type$ defaultValue) {\n" " $key_null_check$\n" @@ -768,7 +768,7 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " instance.get$capitalized_name$Map();\n" " return map.containsKey(key) ? map.get(key) : defaultValue;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "@java.lang.Override\n" @@ -783,12 +783,12 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " }\n" " return map.get(key);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "$deprecation$" - "public Builder ${$put$capitalized_name$$}$(\n" + "public Builder ${$put$capitalized_name$$}$(\n" " $key_type$ key,\n" " $value_type$ value) {\n" " $key_null_check$\n" @@ -797,18 +797,18 @@ void ImmutableMapFieldLiteGenerator::GenerateBuilderMembers( " instance.getMutable$capitalized_name$Map().put(key, value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, "$deprecation$" - "public Builder ${$putAll$capitalized_name$$}$(\n" + "public Builder ${$putAll$capitalized_name$$}$(\n" " java.util.Map<$type_parameters$> values) {\n" " copyOnWrite();\n" " instance.getMutable$capitalized_name$Map().putAll(values);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_map_field_lite.h b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_map_field_lite.h index 99a3eb8a16..f2773f5b35 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_map_field_lite.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_map_field_lite.h @@ -58,7 +58,7 @@ class ImmutableMapFieldLiteGenerator : public ImmutableFieldLiteGenerator { void GenerateKotlinDslMembers(io::Printer* printer) const override; TProtoStringType GetBoxedType() const override; - + private: const FieldDescriptor* descriptor_; std::map<TProtoStringType, TProtoStringType> variables_; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message.cc index f3e814554e..029d886cde 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message.cc @@ -259,7 +259,7 @@ void ImmutableMessageGenerator::GenerateInterface(io::Printer* printer) { /* immutable = */ true, "OrBuilder"); if (descriptor_->extension_range_count() > 0) { printer->Print( - "$deprecation$public interface ${$$classname$OrBuilder$}$ extends\n" + "$deprecation$public interface ${$$classname$OrBuilder$}$ extends\n" " $extra_interfaces$\n" " com.google.protobuf.GeneratedMessage$ver$.\n" " ExtendableMessageOrBuilder<$classname$> {\n", @@ -270,7 +270,7 @@ void ImmutableMessageGenerator::GenerateInterface(io::Printer* printer) { GeneratedCodeVersionSuffix()); } else { printer->Print( - "$deprecation$public interface ${$$classname$OrBuilder$}$ extends\n" + "$deprecation$public interface ${$$classname$OrBuilder$}$ extends\n" " $extra_interfaces$\n" " com.google.protobuf.MessageOrBuilder {\n", "deprecation", @@ -278,7 +278,7 @@ void ImmutableMessageGenerator::GenerateInterface(io::Printer* printer) { "extra_interfaces", ExtraMessageOrBuilderInterfaces(descriptor_), "classname", descriptor_->name(), "{", "", "}", ""); } - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); printer->Indent(); for (int i = 0; i < descriptor_->field_count(); i++) { @@ -320,9 +320,9 @@ void ImmutableMessageGenerator::Generate(io::Printer* printer) { // The builder_type stores the super type name of the nested Builder class. TProtoStringType builder_type; if (descriptor_->extension_range_count() > 0) { - printer->Print( - variables, - "$deprecation$public $static$final class $classname$ extends\n"); + printer->Print( + variables, + "$deprecation$public $static$final class $classname$ extends\n"); printer->Annotate("classname", descriptor_); printer->Print( variables, @@ -335,9 +335,9 @@ void ImmutableMessageGenerator::Generate(io::Printer* printer) { name_resolver_->GetImmutableClassName(descriptor_), GeneratedCodeVersionSuffix()); } else { - printer->Print( - variables, - "$deprecation$public $static$final class $classname$ extends\n"); + printer->Print( + variables, + "$deprecation$public $static$final class $classname$ extends\n"); printer->Annotate("classname", descriptor_); printer->Print(variables, " com.google.protobuf.GeneratedMessage$ver$ implements\n" @@ -348,7 +348,7 @@ void ImmutableMessageGenerator::Generate(io::Printer* printer) { GeneratedCodeVersionSuffix()); } printer->Print("private static final long serialVersionUID = 0L;\n"); - + printer->Indent(); // Using builder_type, instead of Builder, prevents the Builder class from // being loaded into PermGen space when the default instance is created. @@ -635,9 +635,9 @@ void ImmutableMessageGenerator::GenerateMessageSerializationMethods( } } - if (descriptor_->options().message_set_wire_format()) { + if (descriptor_->options().message_set_wire_format()) { printer->Print("unknownFields.writeAsMessageSetTo(output);\n"); - } else { + } else { printer->Print("unknownFields.writeTo(output);\n"); } @@ -666,9 +666,9 @@ void ImmutableMessageGenerator::GenerateMessageSerializationMethods( } } - if (descriptor_->options().message_set_wire_format()) { + if (descriptor_->options().message_set_wire_format()) { printer->Print("size += unknownFields.getSerializedSizeAsMessageSet();\n"); - } else { + } else { printer->Print("size += unknownFields.getSerializedSize();\n"); } @@ -1062,10 +1062,10 @@ void ImmutableMessageGenerator::GenerateEqualsAndHashCode( printer->Print("}\n"); } - // Always consider unknown fields for equality. This will sometimes return - // false for non-canonical ordering when running in LITE_RUNTIME but it's - // the best we can do. - printer->Print( + // Always consider unknown fields for equality. This will sometimes return + // false for non-canonical ordering when running in LITE_RUNTIME but it's + // the best we can do. + printer->Print( "if (!unknownFields.equals(other.unknownFields)) return false;\n"); if (descriptor_->extension_range_count() > 0) { printer->Print( @@ -1090,12 +1090,12 @@ void ImmutableMessageGenerator::GenerateEqualsAndHashCode( "}\n" "int hash = 41;\n"); - // If we output a getDescriptor() method, use that as it is more efficient. - if (descriptor_->options().no_standard_descriptor_accessor()) { - printer->Print("hash = (19 * hash) + getDescriptorForType().hashCode();\n"); - } else { - printer->Print("hash = (19 * hash) + getDescriptor().hashCode();\n"); - } + // If we output a getDescriptor() method, use that as it is more efficient. + if (descriptor_->options().no_standard_descriptor_accessor()) { + printer->Print("hash = (19 * hash) + getDescriptorForType().hashCode();\n"); + } else { + printer->Print("hash = (19 * hash) + getDescriptor().hashCode();\n"); + } // hashCode non-oneofs. for (int i = 0; i < descriptor_->field_count(); i++) { @@ -1199,7 +1199,7 @@ void ImmutableMessageGenerator::GenerateParsingConstructor( GetBitFieldName(i)); } - printer->Print( + printer->Print( "com.google.protobuf.UnknownFieldSet.Builder unknownFields =\n" " com.google.protobuf.UnknownFieldSet.newBuilder();\n"); @@ -1286,8 +1286,8 @@ void ImmutableMessageGenerator::GenerateParsingConstructor( field_generators_.get(field).GenerateParsingDoneCode(printer); } - // Make unknown fields immutable. - printer->Print("this.unknownFields = unknownFields.build();\n"); + // Make unknown fields immutable. + printer->Print("this.unknownFields = unknownFields.build();\n"); // Make extensions immutable. printer->Print("makeExtensionsImmutable();\n"); diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_builder.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_builder.cc index 32e9701509..510b9d785c 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_builder.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_builder.cc @@ -170,7 +170,7 @@ void MessageBuilderGenerator::Generate(io::Printer* printer) { // is needed to keep binary compatibility when we change generated code // to subclass a different GeneratedMessage class (e.g., in v3.0.0 release // we changed all generated code to subclass GeneratedMessageV3). - printer->Print( + printer->Print( "@java.lang.Override\n" "public final Builder setUnknownFields(\n" " final com.google.protobuf.UnknownFieldSet unknownFields) {\n" @@ -440,11 +440,11 @@ void MessageBuilderGenerator::GenerateCommonBuilderMethods( "\n", "classname", name_resolver_->GetImmutableClassName(descriptor_)); - // Override methods declared in GeneratedMessage to return the concrete - // generated type so callsites won't depend on GeneratedMessage. This - // is needed to keep binary compatibility when we change generated code - // to subclass a different GeneratedMessage class (e.g., in v3.0.0 release - // we changed all generated code to subclass GeneratedMessageV3). + // Override methods declared in GeneratedMessage to return the concrete + // generated type so callsites won't depend on GeneratedMessage. This + // is needed to keep binary compatibility when we change generated code + // to subclass a different GeneratedMessage class (e.g., in v3.0.0 release + // we changed all generated code to subclass GeneratedMessageV3). printer->Print( "@java.lang.Override\n" "public Builder clone() {\n" diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_field.cc index 44e88b8cc7..6e2f181387 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_field.cc @@ -175,7 +175,7 @@ void ImmutableMessageFieldGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, @@ -183,7 +183,7 @@ void ImmutableMessageFieldGenerator::GenerateMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return $name$_ == null ? $type$.getDefaultInstance() : $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( @@ -193,7 +193,7 @@ void ImmutableMessageFieldGenerator::GenerateMembers( "${$get$capitalized_name$OrBuilder$}$() {\n" " return $name$_ == null ? $type$.getDefaultInstance() : $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } else { WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); printer->Print( @@ -202,7 +202,7 @@ void ImmutableMessageFieldGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $name$_ != null;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, @@ -210,7 +210,7 @@ void ImmutableMessageFieldGenerator::GenerateMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return $name$_ == null ? $type$.getDefaultInstance() : $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, @@ -219,7 +219,7 @@ void ImmutableMessageFieldGenerator::GenerateMembers( "${$get$capitalized_name$OrBuilder$}$() {\n" " return get$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } } @@ -242,7 +242,7 @@ void ImmutableMessageFieldGenerator::PrintNestedBuilderFunction( const char* regular_case, const char* nested_builder_case, const char* trailing_code) const { printer->Print(variables_, method_prototype); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); printer->Print(" {\n"); printer->Indent(); PrintNestedBuilderCondition(printer, regular_case, nested_builder_case); @@ -281,14 +281,14 @@ void ImmutableMessageFieldGenerator::GenerateBuilderMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_builder$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } else { printer->Print( variables_, "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $name$Builder_ != null || $name$_ != null;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } // Field getField() @@ -382,7 +382,7 @@ void ImmutableMessageFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return get$capitalized_name$FieldBuilder().getBuilder();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$public $type$OrBuilder " @@ -394,7 +394,7 @@ void ImmutableMessageFieldGenerator::GenerateBuilderMembers( " $type$.getDefaultInstance() : $name$_;\n" " }\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -580,9 +580,9 @@ void ImmutableMessageOneofFieldGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $has_oneof_case_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, GETTER); - printer->Print(variables_, + printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " if ($has_oneof_case_message$) {\n" @@ -590,7 +590,7 @@ void ImmutableMessageOneofFieldGenerator::GenerateMembers( " }\n" " return $type$.getDefaultInstance();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, @@ -602,7 +602,7 @@ void ImmutableMessageOneofFieldGenerator::GenerateMembers( " }\n" " return $type$.getDefaultInstance();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutableMessageOneofFieldGenerator::GenerateBuilderMembers( @@ -620,14 +620,14 @@ void ImmutableMessageOneofFieldGenerator::GenerateBuilderMembers( // The comments above the methods below are based on a hypothetical // field of type "Field" called "Field". - // boolean hasField() + // boolean hasField() WriteFieldAccessorDocComment(printer, descriptor_, HAZZER); - printer->Print(variables_, + printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $has_oneof_case_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field getField() WriteFieldAccessorDocComment(printer, descriptor_, GETTER); @@ -728,7 +728,7 @@ void ImmutableMessageOneofFieldGenerator::GenerateBuilderMembers( "${$get$capitalized_name$Builder$}$() {\n" " return get$capitalized_name$FieldBuilder().getBuilder();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -744,7 +744,7 @@ void ImmutableMessageOneofFieldGenerator::GenerateBuilderMembers( " return $type$.getDefaultInstance();\n" " }\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -766,7 +766,7 @@ void ImmutableMessageOneofFieldGenerator::GenerateBuilderMembers( " $on_changed$;\n" " return $name$Builder_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutableMessageOneofFieldGenerator::GenerateBuildingCode( @@ -897,7 +897,7 @@ void RepeatedImmutableMessageFieldGenerator::GenerateMembers( "${$get$capitalized_name$List$}$() {\n" " return $name$_;\n" // note: unmodifiable list "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -906,7 +906,7 @@ void RepeatedImmutableMessageFieldGenerator::GenerateMembers( " ${$get$capitalized_name$OrBuilderList$}$() {\n" " return $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -914,7 +914,7 @@ void RepeatedImmutableMessageFieldGenerator::GenerateMembers( "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return $name$_.size();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -922,7 +922,7 @@ void RepeatedImmutableMessageFieldGenerator::GenerateMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" " return $name$_.get(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "@java.lang.Override\n" @@ -931,7 +931,7 @@ void RepeatedImmutableMessageFieldGenerator::GenerateMembers( " int index) {\n" " return $name$_.get(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void RepeatedImmutableMessageFieldGenerator::PrintNestedBuilderCondition( @@ -953,7 +953,7 @@ void RepeatedImmutableMessageFieldGenerator::PrintNestedBuilderFunction( const char* regular_case, const char* nested_builder_case, const char* trailing_code) const { printer->Print(variables_, method_prototype); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); printer->Print(" {\n"); printer->Indent(); PrintNestedBuilderCondition(printer, regular_case, nested_builder_case); @@ -1182,7 +1182,7 @@ void RepeatedImmutableMessageFieldGenerator::GenerateBuilderMembers( " int index) {\n" " return get$capitalized_name$FieldBuilder().getBuilder(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, @@ -1195,7 +1195,7 @@ void RepeatedImmutableMessageFieldGenerator::GenerateBuilderMembers( " return $name$Builder_.getMessageOrBuilder(index);\n" " }\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( @@ -1208,7 +1208,7 @@ void RepeatedImmutableMessageFieldGenerator::GenerateBuilderMembers( " return java.util.Collections.unmodifiableList($name$_);\n" " }\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, @@ -1217,7 +1217,7 @@ void RepeatedImmutableMessageFieldGenerator::GenerateBuilderMembers( " return get$capitalized_name$FieldBuilder().addBuilder(\n" " $type$.getDefaultInstance());\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -1226,7 +1226,7 @@ void RepeatedImmutableMessageFieldGenerator::GenerateBuilderMembers( " return get$capitalized_name$FieldBuilder().addBuilder(\n" " index, $type$.getDefaultInstance());\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -1249,7 +1249,7 @@ void RepeatedImmutableMessageFieldGenerator::GenerateBuilderMembers( " }\n" " return $name$Builder_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void RepeatedImmutableMessageFieldGenerator:: diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_field_lite.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_field_lite.cc index 30e51a4fc1..f36555f00c 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_field_lite.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_field_lite.cc @@ -76,7 +76,7 @@ void SetMessageVariables(const FieldDescriptor* descriptor, int messageBitIndex, ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + " is deprecated\") " : ""; - (*variables)["required"] = descriptor->is_required() ? "true" : "false"; + (*variables)["required"] = descriptor->is_required() ? "true" : "false"; if (HasHasbit(descriptor)) { // For singular messages and builders, one bit is used for the hasField bit. @@ -153,7 +153,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -161,7 +161,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return $name$_ == null ? $type$.getDefaultInstance() : $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } else { WriteFieldDocComment(printer, descriptor_); printer->Print( @@ -170,7 +170,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $name$_ != null;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -178,7 +178,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return $name$_ == null ? $type$.getDefaultInstance() : $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } // Field.Builder setField(Field value) @@ -228,7 +228,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return instance.has$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field getField() WriteFieldDocComment(printer, descriptor_); @@ -237,7 +237,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return instance.get$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field.Builder setField(Field value) WriteFieldDocComment(printer, descriptor_); @@ -248,7 +248,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(value);\n" " return this;\n" " }\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field.Builder setField(Field.Builder builderForValue) WriteFieldDocComment(printer, descriptor_); @@ -259,7 +259,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(builderForValue.build());\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field.Builder mergeField(Field value) WriteFieldDocComment(printer, descriptor_); @@ -270,7 +270,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " instance.merge$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field.Builder clearField() WriteFieldDocComment(printer, descriptor_); @@ -280,7 +280,7 @@ void ImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " instance.clear$capitalized_name$();\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutableMessageFieldLiteGenerator::GenerateKotlinDslMembers( @@ -351,9 +351,9 @@ void ImmutableMessageOneofFieldLiteGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $has_oneof_case_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, + printer->Annotate("{", "}", descriptor_); + WriteFieldDocComment(printer, descriptor_); + printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " if ($has_oneof_case_message$) {\n" @@ -361,7 +361,7 @@ void ImmutableMessageOneofFieldLiteGenerator::GenerateMembers( " }\n" " return $type$.getDefaultInstance();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field.Builder setField(Field value) WriteFieldDocComment(printer, descriptor_); @@ -407,20 +407,20 @@ void ImmutableMessageOneofFieldLiteGenerator::GenerateFieldInfo( WriteIntToUtf16CharSequence(descriptor_->containing_oneof()->index(), output); printer->Print(variables_, "$oneof_stored_type$.class,\n"); } - + void ImmutableMessageOneofFieldLiteGenerator::GenerateBuilderMembers( io::Printer* printer) const { // The comments above the methods below are based on a hypothetical // field of type "Field" called "Field". - // boolean hasField() - WriteFieldDocComment(printer, descriptor_); - printer->Print(variables_, + // boolean hasField() + WriteFieldDocComment(printer, descriptor_); + printer->Print(variables_, "@java.lang.Override\n" "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return instance.has$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field getField() WriteFieldDocComment(printer, descriptor_); @@ -429,7 +429,7 @@ void ImmutableMessageOneofFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return instance.get$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field.Builder setField(Field value) WriteFieldDocComment(printer, descriptor_); @@ -440,7 +440,7 @@ void ImmutableMessageOneofFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field.Builder setField(Field.Builder builderForValue) WriteFieldDocComment(printer, descriptor_); @@ -451,7 +451,7 @@ void ImmutableMessageOneofFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(builderForValue.build());\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field.Builder mergeField(Field value) WriteFieldDocComment(printer, descriptor_); @@ -462,7 +462,7 @@ void ImmutableMessageOneofFieldLiteGenerator::GenerateBuilderMembers( " instance.merge$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field.Builder clearField() WriteFieldDocComment(printer, descriptor_); @@ -473,7 +473,7 @@ void ImmutableMessageOneofFieldLiteGenerator::GenerateBuilderMembers( " instance.clear$capitalized_name$();\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } // =================================================================== @@ -526,7 +526,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateMembers( "${$get$capitalized_name$List$}$() {\n" " return $name$_;\n" // note: unmodifiable list "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -534,7 +534,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateMembers( " ${$get$capitalized_name$OrBuilderList$}$() {\n" " return $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -542,7 +542,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateMembers( "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return $name$_.size();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print( variables_, @@ -550,7 +550,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" " return $name$_.get(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, "$deprecation$public $type$OrBuilder " @@ -558,7 +558,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateMembers( " int index) {\n" " return $name$_.get(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); printer->Print( variables_, @@ -641,7 +641,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " return java.util.Collections.unmodifiableList(\n" " instance.get$capitalized_name$List());\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // int getRepeatedFieldCount() WriteFieldDocComment(printer, descriptor_); @@ -651,7 +651,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return instance.get$capitalized_name$Count();\n" "}"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Field getRepeatedField(int index) WriteFieldDocComment(printer, descriptor_); @@ -661,7 +661,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" " return instance.get$capitalized_name$(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Builder setRepeatedField(int index, Field value) WriteFieldDocComment(printer, descriptor_); @@ -672,7 +672,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(index, value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Builder setRepeatedField(int index, Field.Builder builderForValue) WriteFieldDocComment(printer, descriptor_); @@ -684,7 +684,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " builderForValue.build());\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Builder addRepeatedField(Field value) WriteFieldDocComment(printer, descriptor_); @@ -695,7 +695,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " instance.add$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Builder addRepeatedField(int index, Field value) WriteFieldDocComment(printer, descriptor_); @@ -706,7 +706,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " instance.add$capitalized_name$(index, value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Builder addRepeatedField(Field.Builder builderForValue) WriteFieldDocComment(printer, descriptor_); printer->Print(variables_, @@ -716,7 +716,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " instance.add$capitalized_name$(builderForValue.build());\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Builder addRepeatedField(int index, Field.Builder builderForValue) WriteFieldDocComment(printer, descriptor_); @@ -728,7 +728,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " builderForValue.build());\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Builder addAllRepeatedField(Iterable<Field> values) WriteFieldDocComment(printer, descriptor_); @@ -739,7 +739,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " instance.addAll$capitalized_name$(values);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Builder clearAllRepeatedField() WriteFieldDocComment(printer, descriptor_); @@ -750,7 +750,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " instance.clear$capitalized_name$();\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // Builder removeRepeatedField(int index) WriteFieldDocComment(printer, descriptor_); @@ -761,7 +761,7 @@ void RepeatedImmutableMessageFieldLiteGenerator::GenerateBuilderMembers( " instance.remove$capitalized_name$(index);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void RepeatedImmutableMessageFieldLiteGenerator::GenerateFieldInfo( diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_field_lite.h b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_field_lite.h index 7ad9645fe5..22a12ce857 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_field_lite.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_field_lite.h @@ -122,7 +122,7 @@ class RepeatedImmutableMessageFieldLiteGenerator void GenerateKotlinDslMembers(io::Printer* printer) const override; TProtoStringType GetBoxedType() const override; - + protected: const FieldDescriptor* descriptor_; std::map<TProtoStringType, TProtoStringType> variables_; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_lite.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_lite.cc index e10c0da2b9..bec5a7f47c 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_lite.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_message_lite.cc @@ -113,7 +113,7 @@ void ImmutableMessageLiteGenerator::GenerateInterface(io::Printer* printer) { /* immutable = */ true, "OrBuilder"); if (descriptor_->extension_range_count() > 0) { printer->Print( - "$deprecation$public interface ${$$classname$OrBuilder$}$ extends \n" + "$deprecation$public interface ${$$classname$OrBuilder$}$ extends \n" " $extra_interfaces$\n" " com.google.protobuf.GeneratedMessageLite.\n" " ExtendableMessageOrBuilder<\n" @@ -124,7 +124,7 @@ void ImmutableMessageLiteGenerator::GenerateInterface(io::Printer* printer) { "classname", descriptor_->name(), "{", "", "}", ""); } else { printer->Print( - "$deprecation$public interface ${$$classname$OrBuilder$}$ extends\n" + "$deprecation$public interface ${$$classname$OrBuilder$}$ extends\n" " $extra_interfaces$\n" " com.google.protobuf.MessageLiteOrBuilder {\n", "deprecation", @@ -132,7 +132,7 @@ void ImmutableMessageLiteGenerator::GenerateInterface(io::Printer* printer) { "extra_interfaces", ExtraMessageOrBuilderInterfaces(descriptor_), "classname", descriptor_->name(), "{", "", "}", ""); } - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); printer->Indent(); for (int i = 0; i < descriptor_->field_count(); i++) { @@ -170,7 +170,7 @@ void ImmutableMessageLiteGenerator::Generate(io::Printer* printer) { MaybePrintGeneratedAnnotation(context_, printer, descriptor_, /* immutable = */ true); - + // The builder_type stores the super type name of the nested Builder class. TProtoStringType builder_type; if (descriptor_->extension_range_count() > 0) { @@ -187,7 +187,7 @@ void ImmutableMessageLiteGenerator::Generate(io::Printer* printer) { } else { printer->Print( variables, - "$deprecation$public $static$final class $classname$ extends\n" + "$deprecation$public $static$final class $classname$ extends\n" " com.google.protobuf.GeneratedMessageLite<\n" " $classname$, $classname$.Builder> implements\n" " $extra_interfaces$\n" @@ -229,7 +229,7 @@ void ImmutableMessageLiteGenerator::Generate(io::Printer* printer) { // oneof std::map<TProtoStringType, TProtoStringType> vars; for (auto oneof : oneofs_) { - vars["oneof_name"] = context_->GetOneofGeneratorInfo(oneof)->name; + vars["oneof_name"] = context_->GetOneofGeneratorInfo(oneof)->name; vars["oneof_capitalized_name"] = context_->GetOneofGeneratorInfo(oneof)->capitalized_name; vars["oneof_index"] = StrCat((oneof)->index()); @@ -321,15 +321,15 @@ void ImmutableMessageLiteGenerator::Generate(io::Printer* printer) { printer->Print( "@java.lang.Override\n" - "@java.lang.SuppressWarnings({\"unchecked\", \"fallthrough\"})\n" - "protected final java.lang.Object dynamicMethod(\n" - " com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,\n" - " java.lang.Object arg0, java.lang.Object arg1) {\n" - " switch (method) {\n" - " case NEW_MUTABLE_INSTANCE: {\n" - " return new $classname$();\n" - " }\n", - "classname", name_resolver_->GetImmutableClassName(descriptor_)); + "@java.lang.SuppressWarnings({\"unchecked\", \"fallthrough\"})\n" + "protected final java.lang.Object dynamicMethod(\n" + " com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,\n" + " java.lang.Object arg0, java.lang.Object arg1) {\n" + " switch (method) {\n" + " case NEW_MUTABLE_INSTANCE: {\n" + " return new $classname$();\n" + " }\n", + "classname", name_resolver_->GetImmutableClassName(descriptor_)); printer->Indent(); printer->Indent(); diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_options.h b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_options.h index a7b003427e..1454c23206 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_options.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_options.h @@ -59,10 +59,10 @@ struct Options { bool annotate_code; // Name of a file where we will write a list of generated .meta file names, // one per line. - TProtoStringType annotation_list_file; + TProtoStringType annotation_list_file; // Name of a file where we will write a list of generated file names, one // per line. - TProtoStringType output_list_file; + TProtoStringType output_list_file; }; } // namespace java diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field.cc index d7e6d7c303..ab550761b1 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field.cc @@ -113,7 +113,7 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, : ("= " + ImmutableDefaultValue(descriptor, name_resolver)); (*variables)["capitalized_type"] = GetCapitalizedType(descriptor, /* immutable = */ true); - (*variables)["tag"] = + (*variables)["tag"] = StrCat(static_cast<int32_t>(WireFormat::MakeTag(descriptor))); (*variables)["tag_size"] = StrCat( WireFormat::TagSize(descriptor->number(), GetType(descriptor))); @@ -232,7 +232,7 @@ void ImmutablePrimitiveFieldGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); @@ -241,7 +241,7 @@ void ImmutablePrimitiveFieldGenerator::GenerateMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutablePrimitiveFieldGenerator::GenerateBuilderMembers( @@ -256,7 +256,7 @@ void ImmutablePrimitiveFieldGenerator::GenerateBuilderMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_builder$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); @@ -265,7 +265,7 @@ void ImmutablePrimitiveFieldGenerator::GenerateBuilderMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); @@ -278,7 +278,7 @@ void ImmutablePrimitiveFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); @@ -286,7 +286,7 @@ void ImmutablePrimitiveFieldGenerator::GenerateBuilderMembers( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" " $clear_has_field_bit_builder$\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); JavaType type = GetJavaType(descriptor_); if (type == JAVATYPE_STRING || type == JAVATYPE_BYTES) { // The default value is not a simple literal so we want to avoid executing @@ -549,7 +549,7 @@ void ImmutablePrimitiveOneofFieldGenerator::GenerateMembers( " }\n" " return $default$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutablePrimitiveOneofFieldGenerator::GenerateBuilderMembers( @@ -560,7 +560,7 @@ void ImmutablePrimitiveOneofFieldGenerator::GenerateBuilderMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $has_oneof_case_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -570,7 +570,7 @@ void ImmutablePrimitiveOneofFieldGenerator::GenerateBuilderMembers( " }\n" " return $default$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); @@ -583,7 +583,7 @@ void ImmutablePrimitiveOneofFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); @@ -626,15 +626,15 @@ void ImmutablePrimitiveOneofFieldGenerator::GenerateSerializationCode( printer->Print(variables_, "if ($has_oneof_case_message$) {\n" " output.write$capitalized_type$(\n"); - // $type$ and $boxed_type$ is the same for bytes fields so we don't need to - // do redundant casts. - if (GetJavaType(descriptor_) == JAVATYPE_BYTES) { + // $type$ and $boxed_type$ is the same for bytes fields so we don't need to + // do redundant casts. + if (GetJavaType(descriptor_) == JAVATYPE_BYTES) { printer->Print(variables_, " $number$, ($type$) $oneof_name$_);\n"); - } else { + } else { printer->Print( variables_, " $number$, ($type$)(($boxed_type$) $oneof_name$_));\n"); - } + } printer->Print("}\n"); } @@ -644,15 +644,15 @@ void ImmutablePrimitiveOneofFieldGenerator::GenerateSerializedSizeCode( "if ($has_oneof_case_message$) {\n" " size += com.google.protobuf.CodedOutputStream\n" " .compute$capitalized_type$Size(\n"); - // $type$ and $boxed_type$ is the same for bytes fields so we don't need to - // do redundant casts. - if (GetJavaType(descriptor_) == JAVATYPE_BYTES) { + // $type$ and $boxed_type$ is the same for bytes fields so we don't need to + // do redundant casts. + if (GetJavaType(descriptor_) == JAVATYPE_BYTES) { printer->Print(variables_, " $number$, ($type$) $oneof_name$_);\n"); - } else { + } else { printer->Print( variables_, " $number$, ($type$)(($boxed_type$) $oneof_name$_));\n"); - } + } printer->Print("}\n"); } @@ -705,21 +705,21 @@ void RepeatedImmutablePrimitiveFieldGenerator::GenerateMembers( " ${$get$capitalized_name$List$}$() {\n" " return $name$_;\n" // note: unmodifiable list "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", 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_); + printer->Annotate("{", "}", 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_); + printer->Annotate("{", "}", descriptor_); if (descriptor_->is_packed()) { printer->Print(variables_, @@ -761,21 +761,21 @@ void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuilderMembers( " return $get_mutable_bit_builder$ ?\n" " java.util.Collections.unmodifiableList($name$_) : $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", 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_); + printer->Annotate("{", "}", 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_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, /* builder */ true); printer->Print(variables_, @@ -787,7 +787,7 @@ void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, /* builder */ true); printer->Print(variables_, @@ -799,7 +799,7 @@ void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, /* builder */ true); printer->Print(variables_, @@ -811,7 +811,7 @@ void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -822,7 +822,7 @@ void RepeatedImmutablePrimitiveFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void RepeatedImmutablePrimitiveFieldGenerator::GenerateKotlinDslMembers( diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.cc index 1f31a34992..35f78fce9e 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.cc @@ -79,11 +79,11 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, (*variables)["default"] = ImmutableDefaultValue(descriptor, name_resolver); (*variables)["capitalized_type"] = GetCapitalizedType(descriptor, /* immutable = */ true); - (*variables)["tag"] = + (*variables)["tag"] = StrCat(static_cast<int32_t>(WireFormat::MakeTag(descriptor))); (*variables)["tag_size"] = StrCat( WireFormat::TagSize(descriptor->number(), GetType(descriptor))); - (*variables)["required"] = descriptor->is_required() ? "true" : "false"; + (*variables)["required"] = descriptor->is_required() ? "true" : "false"; TProtoStringType capitalized_type = UnderscoresToCamelCase( PrimitiveTypeName(javaType), true /* cap_next_letter */); @@ -229,7 +229,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); @@ -238,7 +238,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, @@ -275,7 +275,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return instance.has$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); @@ -284,7 +284,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return instance.get$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); @@ -295,7 +295,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); @@ -306,7 +306,7 @@ void ImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( " instance.clear$capitalized_name$();\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutablePrimitiveFieldLiteGenerator::GenerateKotlinDslMembers( @@ -398,7 +398,7 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateMembers( " }\n" " return $default$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, @@ -435,7 +435,7 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return instance.has$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -443,7 +443,7 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$() {\n" " return instance.get$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); @@ -454,7 +454,7 @@ void ImmutablePrimitiveOneofFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); @@ -514,7 +514,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateMembers( " ${$get$capitalized_name$List$}$() {\n" " return $name$_;\n" // note: unmodifiable list "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, @@ -522,7 +522,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateMembers( "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return $name$_.size();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, @@ -530,7 +530,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" " return $repeated_get$(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (!EnableExperimentalRuntimeForLite() && descriptor_->is_packed() && context_->HasGeneratedMethods(descriptor_->containing_type())) { @@ -589,7 +589,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( " return java.util.Collections.unmodifiableList(\n" " instance.get$capitalized_name$List());\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, @@ -597,7 +597,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return instance.get$capitalized_name$Count();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print( variables_, @@ -605,7 +605,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public $type$ ${$get$capitalized_name$$}$(int index) {\n" " return instance.get$capitalized_name$(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); printer->Print(variables_, @@ -615,7 +615,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(index, value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, /* builder */ true); printer->Print(variables_, @@ -625,7 +625,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( " instance.add$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, /* builder */ true); printer->Print(variables_, @@ -635,7 +635,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( " instance.addAll$capitalized_name$(values);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -645,7 +645,7 @@ void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateBuilderMembers( " instance.clear$capitalized_name$();\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateKotlinDslMembers( diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.h b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.h index 2d4721210b..1359c358df 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_primitive_field_lite.h @@ -76,7 +76,7 @@ class ImmutablePrimitiveFieldLiteGenerator void GenerateKotlinDslMembers(io::Printer* printer) const override; TProtoStringType GetBoxedType() const override; - + protected: const FieldDescriptor* descriptor_; std::map<TProtoStringType, TProtoStringType> variables_; @@ -100,7 +100,7 @@ class ImmutablePrimitiveOneofFieldLiteGenerator void GenerateFieldInfo(io::Printer* printer, std::vector<uint16_t>* output) const; - + private: GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutablePrimitiveOneofFieldLiteGenerator); }; @@ -123,7 +123,7 @@ class RepeatedImmutablePrimitiveFieldLiteGenerator void GenerateKotlinDslMembers(io::Printer* printer) const override; TProtoStringType GetBoxedType() const override; - + private: const FieldDescriptor* descriptor_; std::map<TProtoStringType, TProtoStringType> variables_; diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_service.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_service.cc index 5a5e5e1273..05748f5847 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_service.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_service.cc @@ -185,9 +185,9 @@ void ImmutableServiceGenerator::GenerateAbstractMethods(io::Printer* printer) { TProtoStringType ImmutableServiceGenerator::GetOutput( const MethodDescriptor* method) { - return name_resolver_->GetImmutableClassName(method->output_type()); -} - + return name_resolver_->GetImmutableClassName(method->output_type()); +} + void ImmutableServiceGenerator::GenerateCallMethod(io::Printer* printer) { printer->Print( "\n" @@ -212,7 +212,7 @@ void ImmutableServiceGenerator::GenerateCallMethod(io::Printer* printer) { vars["index"] = StrCat(i); vars["method"] = UnderscoresToCamelCase(method); vars["input"] = name_resolver_->GetImmutableClassName(method->input_type()); - vars["output"] = GetOutput(method); + vars["output"] = GetOutput(method); printer->Print( vars, "case $index$:\n" @@ -259,7 +259,7 @@ void ImmutableServiceGenerator::GenerateCallBlockingMethod( vars["index"] = StrCat(i); vars["method"] = UnderscoresToCamelCase(method); vars["input"] = name_resolver_->GetImmutableClassName(method->input_type()); - vars["output"] = GetOutput(method); + vars["output"] = GetOutput(method); printer->Print(vars, "case $index$:\n" " return impl.$method$(controller, ($input$)request);\n"); @@ -357,7 +357,7 @@ void ImmutableServiceGenerator::GenerateStub(io::Printer* printer) { std::map<TProtoStringType, TProtoStringType> vars; vars["index"] = StrCat(i); - vars["output"] = GetOutput(method); + vars["output"] = GetOutput(method); printer->Print(vars, "channel.callMethod(\n" " getDescriptor().getMethods().get($index$),\n" @@ -421,7 +421,7 @@ void ImmutableServiceGenerator::GenerateBlockingStub(io::Printer* printer) { std::map<TProtoStringType, TProtoStringType> vars; vars["index"] = StrCat(i); - vars["output"] = GetOutput(method); + vars["output"] = GetOutput(method); printer->Print(vars, "return ($output$) channel.callBlockingMethod(\n" " getDescriptor().getMethods().get($index$),\n" @@ -445,7 +445,7 @@ void ImmutableServiceGenerator::GenerateMethodSignature( std::map<TProtoStringType, TProtoStringType> vars; vars["name"] = UnderscoresToCamelCase(method); vars["input"] = name_resolver_->GetImmutableClassName(method->input_type()); - vars["output"] = GetOutput(method); + vars["output"] = GetOutput(method); vars["abstract"] = (is_abstract == IS_ABSTRACT) ? "abstract" : ""; printer->Print(vars, "public $abstract$ void $name$(\n" @@ -459,7 +459,7 @@ void ImmutableServiceGenerator::GenerateBlockingMethodSignature( std::map<TProtoStringType, TProtoStringType> vars; vars["method"] = UnderscoresToCamelCase(method); vars["input"] = name_resolver_->GetImmutableClassName(method->input_type()); - vars["output"] = GetOutput(method); + vars["output"] = GetOutput(method); printer->Print(vars, "\n" "public $output$ $method$(\n" diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_service.h b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_service.h index f8de994bea..e3d52a40ca 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_service.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_service.h @@ -123,9 +123,9 @@ class ImmutableServiceGenerator : public ServiceGenerator { void GenerateBlockingMethodSignature(io::Printer* printer, const MethodDescriptor* method); - // Return the output type of the method. + // Return the output type of the method. TProtoStringType GetOutput(const MethodDescriptor* method); - + Context* context_; ClassNameResolver* name_resolver_; GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableServiceGenerator); diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_shared_code_generator.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_shared_code_generator.cc index 3a03024daa..a0d5e2b45f 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_shared_code_generator.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_shared_code_generator.cc @@ -167,12 +167,12 @@ void SharedCodeGenerator::GenerateDescriptors(io::Printer* printer) { TProtoStringType classname = name_resolver_->GetDescriptorClassName(file_->dependency(i)); TProtoStringType full_name; - if (package.empty()) { - full_name = classname; - } else { - full_name = package + "." + classname; - } - dependencies.push_back(std::make_pair(filename, full_name)); + if (package.empty()) { + full_name = classname; + } else { + full_name = package + "." + classname; + } + dependencies.push_back(std::make_pair(filename, full_name)); } // ----------------------------------------------------------------- diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_shared_code_generator.h b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_shared_code_generator.h index 6023bf2a55..93fe6d7996 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_shared_code_generator.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_shared_code_generator.h @@ -69,7 +69,7 @@ class SharedCodeGenerator { SharedCodeGenerator(const FileDescriptor* file, const Options& options); ~SharedCodeGenerator(); - void Generate(GeneratorContext* generator_context, + void Generate(GeneratorContext* generator_context, std::vector<TProtoStringType>* file_list, std::vector<TProtoStringType>* annotation_file_list); diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field.cc index a919855889..e0019a5ffe 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field.cc @@ -72,7 +72,7 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, (*variables)["default_init"] = "= " + ImmutableDefaultValue(descriptor, name_resolver); (*variables)["capitalized_type"] = "String"; - (*variables)["tag"] = + (*variables)["tag"] = StrCat(static_cast<int32_t>(WireFormat::MakeTag(descriptor))); (*variables)["tag_size"] = StrCat( WireFormat::TagSize(descriptor->number(), GetType(descriptor))); @@ -222,7 +222,7 @@ void ImmutableStringFieldGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); @@ -237,7 +237,7 @@ void ImmutableStringFieldGenerator::GenerateMembers( " com.google.protobuf.ByteString bs = \n" " (com.google.protobuf.ByteString) ref;\n" " java.lang.String s = bs.toStringUtf8();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (CheckUtf8(descriptor_)) { printer->Print(variables_, " $name$_ = s;\n"); } else { @@ -266,7 +266,7 @@ void ImmutableStringFieldGenerator::GenerateMembers( " return (com.google.protobuf.ByteString) ref;\n" " }\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutableStringFieldGenerator::GenerateBuilderMembers( @@ -280,7 +280,7 @@ void ImmutableStringFieldGenerator::GenerateBuilderMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_builder$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); @@ -292,7 +292,7 @@ void ImmutableStringFieldGenerator::GenerateBuilderMembers( " com.google.protobuf.ByteString bs =\n" " (com.google.protobuf.ByteString) ref;\n" " java.lang.String s = bs.toStringUtf8();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (CheckUtf8(descriptor_)) { printer->Print(variables_, " $name$_ = s;\n"); } else { @@ -323,7 +323,7 @@ void ImmutableStringFieldGenerator::GenerateBuilderMembers( " return (com.google.protobuf.ByteString) ref;\n" " }\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); @@ -336,14 +336,14 @@ void ImmutableStringFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( variables_, "$deprecation$public Builder ${$clear$capitalized_name$$}$() {\n" " $clear_has_field_bit_builder$\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); // The default value is not a simple literal so we want to avoid executing // it multiple times. Instead, get the default out of the default instance. printer->Print(variables_, @@ -360,7 +360,7 @@ void ImmutableStringFieldGenerator::GenerateBuilderMembers( "$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n" " com.google.protobuf.ByteString value) {\n" "$null_check$"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (CheckUtf8(descriptor_)) { printer->Print(variables_, " checkByteStringIsUtf8(value);\n"); } @@ -525,7 +525,7 @@ void ImmutableStringOneofFieldGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $has_oneof_case_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( @@ -541,7 +541,7 @@ void ImmutableStringOneofFieldGenerator::GenerateMembers( " com.google.protobuf.ByteString bs = \n" " (com.google.protobuf.ByteString) ref;\n" " java.lang.String s = bs.toStringUtf8();\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (CheckUtf8(descriptor_)) { printer->Print(variables_, " if ($has_oneof_case_message$) {\n" @@ -578,7 +578,7 @@ void ImmutableStringOneofFieldGenerator::GenerateMembers( " return (com.google.protobuf.ByteString) ref;\n" " }\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutableStringOneofFieldGenerator::GenerateBuilderMembers( @@ -590,7 +590,7 @@ void ImmutableStringOneofFieldGenerator::GenerateBuilderMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $has_oneof_case_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( @@ -644,7 +644,7 @@ void ImmutableStringOneofFieldGenerator::GenerateBuilderMembers( " return (com.google.protobuf.ByteString) ref;\n" " }\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); @@ -657,7 +657,7 @@ void ImmutableStringOneofFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -670,7 +670,7 @@ void ImmutableStringOneofFieldGenerator::GenerateBuilderMembers( " }\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); @@ -679,7 +679,7 @@ void ImmutableStringOneofFieldGenerator::GenerateBuilderMembers( "$deprecation$public Builder ${$set$capitalized_name$Bytes$}$(\n" " com.google.protobuf.ByteString value) {\n" "$null_check$"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (CheckUtf8(descriptor_)) { printer->Print(variables_, " checkByteStringIsUtf8(value);\n"); } @@ -800,21 +800,21 @@ void RepeatedImmutableStringFieldGenerator::GenerateMembers( " ${$get$capitalized_name$List$}$() {\n" " return $name$_;\n" // note: unmodifiable list "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", 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_); + printer->Annotate("{", "}", 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_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, @@ -822,7 +822,7 @@ void RepeatedImmutableStringFieldGenerator::GenerateMembers( " ${$get$capitalized_name$Bytes$}$(int index) {\n" " return $name$_.getByteString(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers( @@ -859,21 +859,21 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers( " ${$get$capitalized_name$List$}$() {\n" " return $name$_.getUnmodifiableView();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", 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_); + printer->Annotate("{", "}", 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_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, @@ -881,7 +881,7 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers( " ${$get$capitalized_name$Bytes$}$(int index) {\n" " return $name$_.getByteString(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, /* builder */ true); printer->Print(variables_, @@ -893,7 +893,7 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, /* builder */ true); printer->Print(variables_, @@ -905,7 +905,7 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, /* builder */ true); printer->Print(variables_, @@ -917,7 +917,7 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -928,7 +928,7 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers( " $on_changed$\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_ADDER, /* builder */ true); @@ -937,7 +937,7 @@ void RepeatedImmutableStringFieldGenerator::GenerateBuilderMembers( "$deprecation$public Builder ${$add$capitalized_name$Bytes$}$(\n" " com.google.protobuf.ByteString value) {\n" "$null_check$"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (CheckUtf8(descriptor_)) { printer->Print(variables_, " checkByteStringIsUtf8(value);\n"); } diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.cc b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.cc index e7e7ddcedd..bfaedeba9a 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.cc @@ -72,8 +72,8 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, (*variables)["default"] = ImmutableDefaultValue(descriptor, name_resolver); (*variables)["default_init"] = "= " + ImmutableDefaultValue(descriptor, name_resolver); - (*variables)["capitalized_type"] = "java.lang.String"; - (*variables)["tag"] = + (*variables)["capitalized_type"] = "java.lang.String"; + (*variables)["tag"] = StrCat(static_cast<int32_t>(WireFormat::MakeTag(descriptor))); (*variables)["tag_size"] = StrCat( WireFormat::TagSize(descriptor->number(), GetType(descriptor))); @@ -91,7 +91,7 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor, ? "@kotlin.Deprecated(message = \"Field " + (*variables)["name"] + " is deprecated\") " : ""; - (*variables)["required"] = descriptor->is_required() ? "true" : "false"; + (*variables)["required"] = descriptor->is_required() ? "true" : "false"; if (HasHasbit(descriptor)) { // For singular messages and builders, one bit is used for the hasField bit. @@ -192,7 +192,7 @@ void ImmutableStringFieldLiteGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $get_has_field_bit_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); @@ -202,7 +202,7 @@ void ImmutableStringFieldLiteGenerator::GenerateMembers( "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" " return $name$_;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); printer->Print( variables_, @@ -211,7 +211,7 @@ void ImmutableStringFieldLiteGenerator::GenerateMembers( " ${$get$capitalized_name$Bytes$}$() {\n" " return com.google.protobuf.ByteString.copyFromUtf8($name$_);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, @@ -254,7 +254,7 @@ void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return instance.has$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } WriteFieldAccessorDocComment(printer, descriptor_, GETTER); @@ -264,7 +264,7 @@ void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" " return instance.get$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -273,7 +273,7 @@ void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers( " ${$get$capitalized_name$Bytes$}$() {\n" " return instance.get$capitalized_name$Bytes();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); @@ -284,7 +284,7 @@ void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -294,7 +294,7 @@ void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers( " instance.clear$capitalized_name$();\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); @@ -306,7 +306,7 @@ void ImmutableStringFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$Bytes(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void ImmutableStringFieldLiteGenerator::GenerateKotlinDslMembers( @@ -380,7 +380,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return $has_oneof_case_message$;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( @@ -393,7 +393,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateMembers( " }\n" " return ref;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -406,7 +406,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateMembers( " }\n" " return com.google.protobuf.ByteString.copyFromUtf8(ref);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, @@ -416,7 +416,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateMembers( " $set_oneof_case_message$;\n" " $oneof_name$_ = value;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER); printer->Print(variables_, "private void ${$clear$capitalized_name$$}$() {\n" @@ -425,13 +425,13 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateMembers( " $oneof_name$_ = null;\n" " }\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, SETTER); printer->Print(variables_, "private void ${$set$capitalized_name$Bytes$}$(\n" " com.google.protobuf.ByteString value) {\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); if (CheckUtf8(descriptor_)) { printer->Print(variables_, " checkByteStringIsUtf8(value);\n"); } @@ -448,7 +448,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateFieldInfo( output); WriteIntToUtf16CharSequence(descriptor_->containing_oneof()->index(), output); } - + void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers( io::Printer* printer) const { GOOGLE_DCHECK(HasHazzer(descriptor_)); @@ -458,7 +458,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public boolean ${$has$capitalized_name$$}$() {\n" " return instance.has$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, GETTER); printer->Print( @@ -467,7 +467,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public java.lang.String ${$get$capitalized_name$$}$() {\n" " return instance.get$capitalized_name$();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, GETTER); printer->Print(variables_, @@ -476,7 +476,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers( " ${$get$capitalized_name$Bytes$}$() {\n" " return instance.get$capitalized_name$Bytes();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, SETTER, /* builder */ true); @@ -487,7 +487,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -509,7 +509,7 @@ void ImmutableStringOneofFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$Bytes(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } // =================================================================== @@ -564,7 +564,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateMembers( "${$get$capitalized_name$List$}$() {\n" " return $name$_;\n" // note: unmodifiable list "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, @@ -572,7 +572,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateMembers( "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return $name$_.size();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, "@java.lang.Override\n" @@ -580,7 +580,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateMembers( "${$get$capitalized_name$$}$(int index) {\n" " return $name$_.get(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, @@ -590,7 +590,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateMembers( " return com.google.protobuf.ByteString.copyFromUtf8(\n" " $name$_.get(index));\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); printer->Print( variables_, @@ -657,7 +657,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers( " return java.util.Collections.unmodifiableList(\n" " instance.get$capitalized_name$List());\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_COUNT); printer->Print( variables_, @@ -665,7 +665,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers( "$deprecation$public int ${$get$capitalized_name$Count$}$() {\n" " return instance.get$capitalized_name$Count();\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, "@java.lang.Override\n" @@ -673,7 +673,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers( "${$get$capitalized_name$$}$(int index) {\n" " return instance.get$capitalized_name$(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_INDEXED_GETTER); printer->Print(variables_, @@ -682,7 +682,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers( " ${$get$capitalized_name$Bytes$}$(int index) {\n" " return instance.get$capitalized_name$Bytes(index);\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER, /* builder */ true); printer->Print(variables_, @@ -692,7 +692,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers( " instance.set$capitalized_name$(index, value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER, /* builder */ true); printer->Print(variables_, @@ -702,7 +702,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers( " instance.add$capitalized_name$(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER, /* builder */ true); printer->Print(variables_, @@ -712,7 +712,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers( " instance.addAll$capitalized_name$(values);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldAccessorDocComment(printer, descriptor_, CLEARER, /* builder */ true); printer->Print( @@ -722,7 +722,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers( " instance.clear$capitalized_name$();\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); WriteFieldStringBytesAccessorDocComment(printer, descriptor_, LIST_ADDER, /* builder */ true); @@ -734,7 +734,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateBuilderMembers( " instance.add$capitalized_name$Bytes(value);\n" " return this;\n" "}\n"); - printer->Annotate("{", "}", descriptor_); + printer->Annotate("{", "}", descriptor_); } void RepeatedImmutableStringFieldLiteGenerator::GenerateKotlinDslMembers( @@ -852,7 +852,7 @@ void RepeatedImmutableStringFieldLiteGenerator::GenerateInitializationCode( } TProtoStringType RepeatedImmutableStringFieldLiteGenerator::GetBoxedType() const { - return "java.lang.String"; + return "java.lang.String"; } } // namespace java diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.h b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.h index f4ac150856..02cf5c1657 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.h +++ b/contrib/libs/protoc/src/google/protobuf/compiler/java/java_string_field_lite.h @@ -77,7 +77,7 @@ class ImmutableStringFieldLiteGenerator : public ImmutableFieldLiteGenerator { void GenerateKotlinDslMembers(io::Printer* printer) const override; TProtoStringType GetBoxedType() const override; - + protected: const FieldDescriptor* descriptor_; std::map<TProtoStringType, TProtoStringType> variables_; @@ -122,7 +122,7 @@ class RepeatedImmutableStringFieldLiteGenerator void GenerateKotlinDslMembers(io::Printer* printer) const override; TProtoStringType GetBoxedType() const override; - + private: const FieldDescriptor* descriptor_; std::map<TProtoStringType, TProtoStringType> variables_; |