Order of lines of code in the generated equals and hashCode methods was non-deterministic. This means that the generated files with code have changed between generations (even if nothing has changed in the schema itself).
After the change, the order of these lines will be the same as the order of fields in the schema.
To do
[ ] Integration tests.
I think I need some guidance here. @joelittlejohn, do you think this deserves to be tested? Are there any integration tests that inspect generated methods' code?
Example for hashCode
For a simple schema that includes two fields: field1 and field2, the generator randomly produced either
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.field1 == null)? 0 :this.field1.hashCode()));
result = ((result* 31)+((this.field2 == null)? 0 :this.field2.hashCode()));
return result;
}
or
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.field2== null)? 0 :this.field2.hashCode()));
result = ((result* 31)+((this.field1 == null)? 0 :this.field1.hashCode()));
return result;
}
Description
Order of lines of code in the generated
equals
andhashCode
methods was non-deterministic. This means that the generated files with code have changed between generations (even if nothing has changed in the schema itself).After the change, the order of these lines will be the same as the order of fields in the schema.
To do
Example for
hashCode
For a simple schema that includes two fields:
field1
andfield2
, the generator randomly produced eitheror