Javadoc for Class.getFields() say: \"The elements in the array returned are not sorted and are not in any particular order.\"
Class.getFields()
Any hints on how the order act
It should be stable, and for Oracle's JVM its the order they are declared, but you should not rely on this.
You should base lookup on the field's name (and possibly declaring class) rather than position.