diff options
author | Max Cai <maxtroy@google.com> | 2013-10-11 13:39:49 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-11 13:39:49 -0700 |
commit | 145af9e8915a5e814d5deba8bcea68d066dd7f9e (patch) | |
tree | 621129d4fe4d5960a50b5fc767ff27104e4cf432 /src/google/protobuf/compiler/javanano/javanano_message.cc | |
parent | 7457ebc9ae3eee30ccb44f259a14316e7d9ab950 (diff) | |
parent | 39cee9f1f5cd513a53ac5100eb208ed431f99af0 (diff) | |
download | external_protobuf-145af9e8915a5e814d5deba8bcea68d066dd7f9e.zip external_protobuf-145af9e8915a5e814d5deba8bcea68d066dd7f9e.tar.gz external_protobuf-145af9e8915a5e814d5deba8bcea68d066dd7f9e.tar.bz2 |
am 39cee9f1: Merge "Remove all field initializers and let ctor call clear()."
* commit '39cee9f1f5cd513a53ac5100eb208ed431f99af0':
Remove all field initializers and let ctor call clear().
Diffstat (limited to 'src/google/protobuf/compiler/javanano/javanano_message.cc')
-rw-r--r-- | src/google/protobuf/compiler/javanano/javanano_message.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/google/protobuf/compiler/javanano/javanano_message.cc b/src/google/protobuf/compiler/javanano/javanano_message.cc index c9ea654..420405d 100644 --- a/src/google/protobuf/compiler/javanano/javanano_message.cc +++ b/src/google/protobuf/compiler/javanano/javanano_message.cc @@ -144,7 +144,9 @@ void MessageGenerator::Generate(io::Printer* printer) { printer->Indent(); printer->Print( "public static final $classname$ EMPTY_ARRAY[] = {};\n" - "public $classname$() {}\n" + "public $classname$() {\n" + " clear();\n" + "}\n" "\n", "classname", descriptor_->name()); @@ -244,7 +246,7 @@ GenerateMessageSerializationMethods(io::Printer* printer) { printer->Print( "}\n" "\n" - "private int cachedSize = -1;\n" + "private int cachedSize;\n" "@Override\n" "public int getCachedSize() {\n" " if (cachedSize < 0) {\n" |