Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void SingleFieldGenerator::GenerateFieldBuilderHeader(io::Printer* printer)
"- (nonnull $classname$_Builder *)set$capitalized_name$With$parameter_type$:\n"
" ($nonnull_type$)value;\n"
"- (nonnull $classname$_Builder *)clear$capitalized_name$;\n");

if (CanGenerateProperty(descriptor_)) {
printer->Print(GetStorageType(descriptor_) == GetNonNullType(descriptor_)
? "@property (" : "@property (nonnull, retain, ");
Expand All @@ -340,7 +340,7 @@ void SingleFieldGenerator::GenerateFieldBuilderHeader(io::Printer* printer)
"setter=Set$capitalized_name$With$parameter_type$:) "
"$storage_type$ $camelcase_name$;\n");
}

if (GetJavaType(descriptor_) == JAVATYPE_MESSAGE) {
printer->Print(variables_,
"- (nonnull $classname$_Builder*)\n"
Expand Down Expand Up @@ -417,7 +417,7 @@ void RepeatedFieldGenerator::GenerateFieldBuilderHeader(io::Printer* printer)
if (IsGenerateProperties(descriptor_->file())) {
printer->Print(
variables_,
"- (nonnull $classname$_Builder *)add$capitalized_name$:\n"
"- (nonnull $classname$_Builder *)add$capitalized_name$Value:\n"
" ($nonnull_type$)value;\n");
}
if (GetJavaType(descriptor_) == JAVATYPE_MESSAGE) {
Expand Down Expand Up @@ -523,11 +523,11 @@ void MapFieldGenerator::GenerateFieldBuilderHeader(io::Printer* printer) const {
"*)put$capitalized_name$With$key_parameter_type$:"
"($key_storage_type$)key with$value_parameter_type$:"
"($value_nonnull_type$)value;\n");

if (IsGenerateProperties(descriptor_->file())) {
printer->Print(
variables_,
"- (nonnull $classname$_Builder *)put$capitalized_name$:"
"- (nonnull $classname$_Builder *)put$capitalized_name$Key:"
"($key_nonnull_type$)key value:($value_nonnull_type$)value;\n");
}
}
Expand Down Expand Up @@ -565,7 +565,7 @@ void MapFieldGenerator::GenerateMessageOrBuilderProtocol(
"with$value_parameter_type$:($value_nonnull_type$)defaultValue;\n"
"- ($value_nonnull_type$)get$capitalized_name$OrThrowWith"
"$key_parameter_type$:($key_storage_type$)key;\n");

if (IsGenerateProperties(descriptor_->file())) {
printer->Print(
variables_,
Expand Down
4 changes: 2 additions & 2 deletions protobuf/runtime/src/com/google/protobuf/GeneratedMessage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ static BOOL ResolveAddAccessor(Class cls, CGPDescriptor *descriptor, SEL sel, co
ComGoogleProtobufDescriptors_FieldDescriptor *field = fieldsBuf[i];
const char *tail = selName;
if (MatchesName(&tail, field) &&
(Matches(&tail, "With", 4) ? MatchesKeyword(&tail, field) : true)) {
(Matches(&tail, "With", 4) ? MatchesKeyword(&tail, field) : Matches(&tail, "Value", 5))) {
if (MatchesEnd(tail, ":")) {
return AddAdderMethod(cls, sel, field);
} else if (MatchesEnd(tail, "_Builder:")) {
Expand Down Expand Up @@ -1234,7 +1234,7 @@ static BOOL ResolvePutAccessor(Class cls, CGPDescriptor *descriptor, SEL sel, co
MatchesEnd(tail, ":")) {
return AddPutMethod(cls, sel, field);
}
if (Matches(&tail, ":value", 6) && MatchesEnd(tail, ":")) {
if (Matches(&tail, "Key", 3) && Matches(&tail, ":value", 6) && MatchesEnd(tail, ":")) {
return AddPutMethod(cls, sel, field);
}
}
Expand Down