[LANG-1500] Test may fail due to a different order of fields returned by

reflection api #480.
This commit is contained in:
Gary Gregory 2019-11-22 12:18:04 -05:00
parent bc8a3b9d84
commit f25b44b25f
2 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,7 @@ The <action> type attribute can be add,update,fix,remove.
<action issue="LANG-1177" type="add" dev="ggregory" due-to="Liel Fridman">Added indexesOf methods and simplified removeAllOccurences #471.</action>
<action issue="LANG-1498" type="add" dev="ggregory" due-to="Lysergid, Gary Gregory">Add support of lambda value evaluation for defaulting methods #416.</action>
<action issue="LANG-1463" type="fix" dev="ggregory" due-to="bbeckercscc, Gary Gregory">StringUtils abbreviate returns String of length greater than maxWidth #477.</action>
<action issue="LANG-1500" type="fix" dev="ggregory" due-to="contextshuffling">StringUtils abbreviate returns String of length greater than maxWidth #477.</action>
</release>
<release version="3.9" date="2019-04-09" description="New features and bug fixes. Requires Java 8, supports Java 9, 10, 11.">

View File

@ -190,6 +190,7 @@ private static void reflectionAppend(final Object object, final Class<?> clazz,
}
try {
register(object);
// The elements in the returned array are not sorted and are not in any particular order.
final Field[] fields = clazz.getDeclaredFields();
Arrays.sort(fields, Comparator.comparing(Field::getName));
AccessibleObject.setAccessible(fields, true);