Converter转换规则变更,空对象、空值转为Bean时,创建默认对象,而非nul

This commit is contained in:
Looly
2024-07-11 12:43:27 +08:00
parent dc561b12e3
commit e9e4a49132
6 changed files with 61 additions and 16 deletions

View File

@@ -293,6 +293,12 @@ public class JSONConverter implements Converter, Serializable {
return (T) RecordConverter.INSTANCE.convert(type, value);
}
// 空值转空Bean
if(ObjUtil.isEmpty(value)){
// issue#3649 空值转空对象,则直接实例化
return ConstructorUtil.newInstanceIfPossible(rowType);
}
// 表示非需要特殊转换的对象
return null;
}