Fixed the flakiness in the test com.j256.ormlite.field.FieldTypeTest.testCanBeNull. It was flaky because the order of fields the method getDeclaredFields() returns is nondeterministic. I sort the Fields[] after I get them, so the field that can be null will always be the second one in the Field[], and the field which can't be null will be the first one. Then I get the name field by using Field field = fields[1];, Field field = fields[0]; respectively.
Fixed the flakiness in the test
com.j256.ormlite.field.FieldTypeTest.testCanBeNull
. It was flaky because the order of fields the methodgetDeclaredFields()
returns is nondeterministic. I sort the Fields[] after I get them, so the field that can be null will always be the second one in the Field[], and the field which can't be null will be the first one. Then I get the name field by usingField field = fields[1];
,Field field = fields[0];
respectively.