HHH-18445 Always preserve correct property order for java records
This commit is contained in:
parent
f9a4efaa8f
commit
234bff41b8
|
@ -139,8 +139,8 @@ public class PropertyContainer {
|
||||||
List<MethodDetails> getters) {
|
List<MethodDetails> getters) {
|
||||||
final Map<String, MemberDetails> attributeMemberMap;
|
final Map<String, MemberDetails> attributeMemberMap;
|
||||||
// If the record class has only record components which match up with fields and no additional getters,
|
// If the record class has only record components which match up with fields and no additional getters,
|
||||||
// we can retain the property order, to match up with the record component order
|
// we must retain the property order, to match up with the record component order
|
||||||
if ( !recordComponents.isEmpty() && recordComponents.size() == fields.size() && getters.isEmpty() ) {
|
if ( !recordComponents.isEmpty() && recordComponents.size() == fields.size() ) {
|
||||||
attributeMemberMap = new LinkedHashMap<>();
|
attributeMemberMap = new LinkedHashMap<>();
|
||||||
}
|
}
|
||||||
//otherwise we sort them in alphabetical order, since this is at least deterministic
|
//otherwise we sort them in alphabetical order, since this is at least deterministic
|
||||||
|
|
Loading…
Reference in New Issue