aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2014-03-21 17:08:30 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-03-21 17:08:31 +0000
commitddc98d6dd0800d180454b40ac9cc80f61cc53c21 (patch)
tree86ca269ba05f0c7b2faf133caa8a0a267b937c76 /src
parent3a2109246f0223ad6f14bc986b46453eb51aaadb (diff)
parent5090f19ea7f56a5ceb27a8872a659479282e6871 (diff)
downloadprotobuf-ddc98d6dd0800d180454b40ac9cc80f61cc53c21.tar.gz
protobuf-ddc98d6dd0800d180454b40ac9cc80f61cc53c21.tar.bz2
protobuf-ddc98d6dd0800d180454b40ac9cc80f61cc53c21.zip
Merge "Don't reset cachedSize to 0 in getSerializedSize"
Diffstat (limited to 'src')
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_message.cc5
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 008bec26..3a1b5a50 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");
}