diff options
author | Brian Duff <bduff@google.com> | 2014-09-17 07:34:13 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-17 07:34:13 +0000 |
commit | 278f6dcc643dad84eb40779aec1e0ae20ea2185b (patch) | |
tree | 6f2126722b68644f6e93ab07ef8c8207b3dbe8eb | |
parent | a20fd65468ba6975aa65f1fe565d3dfd23207621 (diff) | |
parent | d3a8acb9a2b3695955c77f364b3a6bd2f1c189bc (diff) | |
download | external_protobuf-278f6dcc643dad84eb40779aec1e0ae20ea2185b.zip external_protobuf-278f6dcc643dad84eb40779aec1e0ae20ea2185b.tar.gz external_protobuf-278f6dcc643dad84eb40779aec1e0ae20ea2185b.tar.bz2 |
am d3a8acb9: Merge "Includes a MessageNano subclass\'s name\'s hashCode in hashCode calculations."
* commit 'd3a8acb9a2b3695955c77f364b3a6bd2f1c189bc':
Includes a MessageNano subclass's name's hashCode in hashCode calculations.
-rw-r--r-- | src/google/protobuf/compiler/javanano/javanano_message.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/javanano/javanano_message.cc b/src/google/protobuf/compiler/javanano/javanano_message.cc index 7a2b4a0..cc44cd3 100644 --- a/src/google/protobuf/compiler/javanano/javanano_message.cc +++ b/src/google/protobuf/compiler/javanano/javanano_message.cc @@ -523,6 +523,7 @@ void MessageGenerator::GenerateHashCode(io::Printer* printer) { printer->Indent(); printer->Print("int result = 17;\n"); + printer->Print("result = 31 * result + getClass().getName().hashCode();\n"); for (int i = 0; i < descriptor_->field_count(); i++) { const FieldDescriptor* field = descriptor_->field(i); field_generators_.get(field).GenerateHashCodeCode(printer); |