Java full runtime: Avoid allocating iterator if UnknownFieldSet's TreeMap is empty
I also considered using Collections.emptyNavigableMap(), which I thought might
use a specialized allocation free empty iterator, but it allocates, and its
clone() method isn't nicely exposed.
Instead of checking the resolved features, we should really be checking the has_presence helper. Repeated fields, oneofs, and extensions can trigger these conditions when they inherit IMPLICIT, even though it's ignored.
Map fields should remain length-prefixed for now, even if DELIMITED is inherited. Field presence will remain unchanged, but unit-tests are added to make sure proto2/proto3 behaviors stay consistent.
Closes #16549
PiperOrigin-RevId: 630191163
9340eec...
by
Protobuf Team Bot <email address hidden>
Split bootstrapped java_features.proto to keep it from leaking out.
This can cause ODR violations in downstream users who link against both the bootstrapped proto and transitive C++ gencode of java_features.proto. Once protoc is split up, we can turn the bootstrapped proto into a real cc_proto_library target and avoid this problem altogether.
PiperOrigin-RevId: 630099889
d3b2fc5...
by
Protobuf Team Bot <email address hidden>
Auto-generate files after cl/630090538
c9eeb1c...
by
Protobuf Team Bot <email address hidden>