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.
This commit is contained in:
commit
7d8185c963
@ -523,6 +523,7 @@ void MessageGenerator::GenerateHashCode(io::Printer* printer) {
|
|||||||
printer->Indent();
|
printer->Indent();
|
||||||
|
|
||||||
printer->Print("int result = 17;\n");
|
printer->Print("int result = 17;\n");
|
||||||
|
printer->Print("result = 31 * result + getClass().getName().hashCode();\n");
|
||||||
for (int i = 0; i < descriptor_->field_count(); i++) {
|
for (int i = 0; i < descriptor_->field_count(); i++) {
|
||||||
const FieldDescriptor* field = descriptor_->field(i);
|
const FieldDescriptor* field = descriptor_->field(i);
|
||||||
field_generators_.get(field).GenerateHashCodeCode(printer);
|
field_generators_.get(field).GenerateHashCodeCode(printer);
|
||||||
|
Loading…
Reference in New Issue
Block a user