aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Duff <bduff@google.com>2014-09-17 07:34:13 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-17 07:34:13 +0000
commit7d8185c963712524b8923c7fa7d1021cd7cf4f6b (patch)
treedea506a915ea4facdad29d36ef3f7a0d0cf933f5
parent6c82acd0c80c637a67dbbda805395407f9e7fc11 (diff)
parent14e2f6cb376a7a7f5b0c0541e60052fe4b373782 (diff)
downloadprotobuf-7d8185c963712524b8923c7fa7d1021cd7cf4f6b.tar.gz
protobuf-7d8185c963712524b8923c7fa7d1021cd7cf4f6b.tar.bz2
protobuf-7d8185c963712524b8923c7fa7d1021cd7cf4f6b.zip
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.cc1
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 7a2b4a06..cc44cd35 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);