diff options
author | Max Cai <maxtroy@google.com> | 2014-04-14 14:57:53 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-04-14 14:57:54 +0000 |
commit | ea68d73c08b3b9319faef8ef9cd283e773a6ef20 (patch) | |
tree | 377a25f535ffb0e37a1762f2d3b7b1ca83a4ece1 /src | |
parent | ce2f59915e0b41c935e3f72a2b7b71b6c19b6860 (diff) | |
parent | c82101204dcde798f870d95e91f5483c3e57eb29 (diff) | |
download | external_protobuf-ea68d73c08b3b9319faef8ef9cd283e773a6ef20.zip external_protobuf-ea68d73c08b3b9319faef8ef9cd283e773a6ef20.tar.gz external_protobuf-ea68d73c08b3b9319faef8ef9cd283e773a6ef20.tar.bz2 |
Merge "Don't reset cachedSize to 0 in getSerializedSize"
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/compiler/javanano/javanano_message.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/google/protobuf/compiler/javanano/javanano_message.cc b/src/google/protobuf/compiler/javanano/javanano_message.cc index 008bec2..3a1b5a5 100644 --- a/src/google/protobuf/compiler/javanano/javanano_message.cc +++ b/src/google/protobuf/compiler/javanano/javanano_message.cc @@ -304,8 +304,8 @@ GenerateMessageSerializationMethods(io::Printer* printer) { printer->Print( "\n" "@Override\n" - "public int getSerializedSize() {\n" - " int size = super.getSerializedSize();\n"); + "protected int computeSerializedSize() {\n" + " int size = super.computeSerializedSize();\n"); printer->Indent(); for (int i = 0; i < descriptor_->field_count(); i++) { @@ -314,7 +314,6 @@ GenerateMessageSerializationMethods(io::Printer* printer) { printer->Outdent(); printer->Print( - " cachedSize = size;\n" " return size;\n" "}\n"); } |