Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Side by Side Diff: third_party/protobuf/src/google/protobuf/compiler/java/java_message_field_lite.cc

Issue 2590803003: Revert "third_party/protobuf: Update to HEAD (83d681ee2c)" (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Protocol Buffers - Google's data interchange format 1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved. 2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/ 3 // https://developers.google.com/protocol-buffers/
4 // 4 //
5 // Redistribution and use in source and binary forms, with or without 5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are 6 // modification, are permitted provided that the following conditions are
7 // met: 7 // met:
8 // 8 //
9 // * Redistributions of source code must retain the above copyright 9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer. 10 // notice, this list of conditions and the following disclaimer.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 namespace compiler { 49 namespace compiler {
50 namespace java { 50 namespace java {
51 51
52 namespace { 52 namespace {
53 53
54 void SetMessageVariables(const FieldDescriptor* descriptor, 54 void SetMessageVariables(const FieldDescriptor* descriptor,
55 int messageBitIndex, 55 int messageBitIndex,
56 int builderBitIndex, 56 int builderBitIndex,
57 const FieldGeneratorInfo* info, 57 const FieldGeneratorInfo* info,
58 ClassNameResolver* name_resolver, 58 ClassNameResolver* name_resolver,
59 std::map<string, string>* variables) { 59 map<string, string>* variables) {
60 SetCommonFieldVariables(descriptor, info, variables); 60 SetCommonFieldVariables(descriptor, info, variables);
61 61
62 (*variables)["type"] = 62 (*variables)["type"] =
63 name_resolver->GetImmutableClassName(descriptor->message_type()); 63 name_resolver->GetImmutableClassName(descriptor->message_type());
64 (*variables)["mutable_type"] = 64 (*variables)["mutable_type"] =
65 name_resolver->GetMutableClassName(descriptor->message_type()); 65 name_resolver->GetMutableClassName(descriptor->message_type());
66 (*variables)["group_or_message"] = 66 (*variables)["group_or_message"] =
67 (GetType(descriptor) == FieldDescriptor::TYPE_GROUP) ? 67 (GetType(descriptor) == FieldDescriptor::TYPE_GROUP) ?
68 "Group" : "Message"; 68 "Group" : "Message";
69 // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported 69 // TODO(birdo): Add @deprecated javadoc when generating javadoc is supported
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 printer->Print(variables_, 138 printer->Print(variables_,
139 "$deprecation$boolean has$capitalized_name$();\n"); 139 "$deprecation$boolean has$capitalized_name$();\n");
140 } 140 }
141 WriteFieldDocComment(printer, descriptor_); 141 WriteFieldDocComment(printer, descriptor_);
142 printer->Print(variables_, 142 printer->Print(variables_,
143 "$deprecation$$type$ get$capitalized_name$();\n"); 143 "$deprecation$$type$ get$capitalized_name$();\n");
144 } 144 }
145 145
146 void ImmutableMessageFieldLiteGenerator:: 146 void ImmutableMessageFieldLiteGenerator::
147 GenerateMembers(io::Printer* printer) const { 147 GenerateMembers(io::Printer* printer) const {
148
149 printer->Print(variables_, 148 printer->Print(variables_,
150 "private $type$ $name$_;\n"); 149 "private $type$ $name$_;\n");
151 PrintExtraFieldInfo(variables_, printer); 150 PrintExtraFieldInfo(variables_, printer);
152 151
153 if (SupportFieldPresence(descriptor_->file())) { 152 if (SupportFieldPresence(descriptor_->file())) {
154 WriteFieldDocComment(printer, descriptor_); 153 WriteFieldDocComment(printer, descriptor_);
155 printer->Print(variables_, 154 printer->Print(variables_,
156 "$deprecation$public boolean has$capitalized_name$() {\n" 155 "$deprecation$public boolean has$capitalized_name$() {\n"
157 " return $get_has_field_bit_message$;\n" 156 " return $get_has_field_bit_message$;\n"
158 "}\n"); 157 "}\n");
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 } 932 }
934 933
935 string RepeatedImmutableMessageFieldLiteGenerator::GetBoxedType() const { 934 string RepeatedImmutableMessageFieldLiteGenerator::GetBoxedType() const {
936 return name_resolver_->GetImmutableClassName(descriptor_->message_type()); 935 return name_resolver_->GetImmutableClassName(descriptor_->message_type());
937 } 936 }
938 937
939 } // namespace java 938 } // namespace java
940 } // namespace compiler 939 } // namespace compiler
941 } // namespace protobuf 940 } // namespace protobuf
942 } // namespace google 941 } // namespace google
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698