mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复BeanUtil.isCommonFieldsEqual判空导致的问题
This commit is contained in:
@@ -994,15 +994,17 @@ public class BeanUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
Map<String, Object> sourceFieldsMap = BeanUtil.beanToMap(source);
|
||||
Map<String, Object> targetFieldsMap = BeanUtil.beanToMap(target);
|
||||
final Map<String, Object> sourceFieldsMap = BeanUtil.beanToMap(source);
|
||||
final Map<String, Object> targetFieldsMap = BeanUtil.beanToMap(target);
|
||||
|
||||
Set<String> sourceFields = sourceFieldsMap.keySet();
|
||||
final Set<String> sourceFields = sourceFieldsMap.keySet();
|
||||
sourceFields.removeAll(Arrays.asList(ignoreProperties));
|
||||
|
||||
for (String field : sourceFields) {
|
||||
if (ObjectUtil.notEqual(sourceFieldsMap.get(field), targetFieldsMap.get(field))) {
|
||||
return false;
|
||||
if(sourceFieldsMap.containsKey(field) && targetFieldsMap.containsKey(field)){
|
||||
if (ObjectUtil.notEqual(sourceFieldsMap.get(field), targetFieldsMap.get(field))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user