Uncouple Java hasbits from C++ hasbits.

There is really no reason for the Java compiler code to call into the internal
C++ implementation of HasHasbit. In the future, the two implementations may
evolve separately and this decoupling can make it easier.

PiperOrigin-RevId: 686672397
pull/18837/head
Tony Liao 5 months ago committed by Copybara-Service
parent c75095b6c6
commit 571ff6f2b2
  1. 2
      src/google/protobuf/compiler/java/helpers.h

@ -338,7 +338,7 @@ bool HasRequiredFields(const Descriptor* descriptor);
bool IsRealOneof(const FieldDescriptor* descriptor);
inline bool HasHasbit(const FieldDescriptor* descriptor) {
return internal::cpp::HasHasbit(descriptor);
return descriptor->has_presence() && !descriptor->real_containing_oneof();
}
// Check whether a message has repeated fields.

Loading…
Cancel
Save