File tree 2 files changed +2
-3
lines changed
protobuf/compiler/src/google/protobuf/compiler/j2objc
2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -283,8 +283,7 @@ void FieldGenerator::GenerateStaticRefs(io::Printer *printer) const {
283
283
SingleFieldGenerator::SingleFieldGenerator (
284
284
const FieldDescriptor *descriptor, uint32_t *numHasBits)
285
285
: FieldGenerator(descriptor) {
286
- if (descriptor->containing_oneof () == nullptr ||
287
- descriptor->containing_oneof ()->is_synthetic ()) {
286
+ if (descriptor->real_containing_oneof () == nullptr ) {
288
287
variables_[" has_bit_index" ] = SimpleItoa ((*numHasBits)++);
289
288
}
290
289
}
Original file line number Diff line number Diff line change @@ -377,7 +377,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
377
377
}
378
378
for (int i = 0 ; i < descriptor_->oneof_decl_count (); i++) {
379
379
const OneofDescriptor* oneof = descriptor_->oneof_decl (i);
380
- if (oneof->is_synthetic () ) {
380
+ if (oneof->field_count () == 1 ) {
381
381
field_generators_.get (oneof->field (0 )).GenerateDeclaration (printer);
382
382
} else {
383
383
printer->Print (" union {\n " );
You can’t perform that action at this time.
0 commit comments