| Index: mojo/public/tools/bindings/generators/java_templates/struct_definition.tmpl
|
| diff --git a/mojo/public/tools/bindings/generators/java_templates/struct_definition.tmpl b/mojo/public/tools/bindings/generators/java_templates/struct_definition.tmpl
|
| index feeeab28532f072ed654688aa601e65771ae72f4..cfc66915e92648d2efc718a756657b8323c36801 100644
|
| --- a/mojo/public/tools/bindings/generators/java_templates/struct_definition.tmpl
|
| +++ b/mojo/public/tools/bindings/generators/java_templates/struct_definition.tmpl
|
| @@ -187,11 +187,13 @@ if (decoder{{level+1}} == null) {
|
| return false;
|
| if (getClass() != object.getClass())
|
| return false;
|
| +{% if struct.fields|length %}
|
| {{struct|name}} other = ({{struct|name}}) object;
|
| -{% for field in struct.fields %}
|
| +{% for field in struct.fields %}
|
| if ({{inequality(field.kind, field|name, 'other.'~field|name)}})
|
| return false;
|
| -{% endfor %}
|
| +{% endfor %}
|
| +{% endif %}
|
| return true;
|
| }
|
|
|
| @@ -201,7 +203,7 @@ if (decoder{{level+1}} == null) {
|
| @Override
|
| public int hashCode() {
|
| final int prime = 31;
|
| - int result = 1;
|
| + int result = prime + getClass().hashCode();
|
| {% for field in struct.fields %}
|
| result = prime * result + {{hash(field.kind, field|name)}};
|
| {% endfor %}
|
|
|