• jasonh+personal@google.com's avatar
    Fix Issue 136: the memoized serialized size for packed fields may not · 9951233e
    jasonh+personal@google.com authored
    be properly set. writeTo() may be invoked without a call to
    getSerializedSize(), so the generated serialization methods would
    write a length of 0 for non-empty packed fields. Just call
    getSerializedSize() at the beginning of writeTo(): although this
    means that we may compute the byte size needlessly when there
    are no packed fields, in practice, getSerializedSize() will
    already have been called - all of the writeTo() wrappers in
    AbstractMessageLite invoke it.
    
    Tested: new unittest case in WireFormatTest.java now passes
    9951233e
Name
Last commit
Last update
..
main/java/com/google/protobuf Loading commit data...
test/java/com/google/protobuf Loading commit data...