[jOOQ/jOOQ#10194] Immutable POJOs with only a single declared constructor should be treated as mutable

This commit is contained in:
Lukas Eder 2020-05-14 19:37:52 +02:00
parent b267964f94
commit f84ba2d317

View File

@ -362,7 +362,8 @@ public class DefaultRecordMapper<R extends Record, E> implements RecordMapper<R,
// [#10194] Check if the POJO is really mutable. There might as well
// be a no-args constructor for other reasons, e.g. when
// using an immutable Kotlin data class with defaulted parameters
if (m.isMutable()) {
// If the no-args constructor is the only one, take it none-theless
if (m.isMutable() || type.getDeclaredConstructors().length <= 1) {
delegate = m;
return;
}