diff options
author | Brian Duff <bduff@google.com> | 2014-09-17 07:13:39 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-09-17 07:13:40 +0000 |
commit | d3a8acb9a2b3695955c77f364b3a6bd2f1c189bc (patch) | |
tree | 6f2126722b68644f6e93ab07ef8c8207b3dbe8eb | |
parent | c4e7b92fefce5b069f50659363c8878612303510 (diff) | |
parent | d0a645c06c723bb309b78af8598ac51d1567f773 (diff) | |
download | external_protobuf-d3a8acb9a2b3695955c77f364b3a6bd2f1c189bc.zip external_protobuf-d3a8acb9a2b3695955c77f364b3a6bd2f1c189bc.tar.gz external_protobuf-d3a8acb9a2b3695955c77f364b3a6bd2f1c189bc.tar.bz2 |
Merge "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); |