|
@@ -23,8 +23,8 @@ public class BeanUtil {
|
|
}
|
|
}
|
|
|
|
|
|
public static <T, S> List<T> setValues(List<S> sourceList, Class<T> target) {
|
|
public static <T, S> List<T> setValues(List<S> sourceList, Class<T> target) {
|
|
- if (CollectionUtils.isEmpty(sourceList)) {
|
|
|
|
- return null;
|
|
|
|
|
|
+ if (CollectionUtils.isEmpty(sourceList)&&sourceList.size()>0) {
|
|
|
|
+ return new ArrayList<>();
|
|
}
|
|
}
|
|
List<T> targetList = new ArrayList<>(sourceList.size());
|
|
List<T> targetList = new ArrayList<>(sourceList.size());
|
|
sourceList.forEach(s -> targetList.add(setValue(s, target)));
|
|
sourceList.forEach(s -> targetList.add(setValue(s, target)));
|