mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
Converter转换规则变更,空对象、空值转为Bean时,创建默认对象,而非nul
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user