This commit is contained in:
Looly 2021-10-07 23:23:29 +08:00
parent 530ce9fab5
commit eae8c6b7f7
2 changed files with 4 additions and 1 deletions

View File

@ -20,6 +20,7 @@
* 【cache 】 优化FIFOCache未设置过期策略时无需遍历判断过期对象pr#425@Gitee
* 【core 】 增加Opt类pr#426@Gitee
* 【core 】 Week增加of重载支持DayOfWekpr#1872@Github
* 【poi 】 优化read避免多次创建CopyOptionsissue#1875@Github
### 🐞Bug修复
* 【http 】 修复HttpCookie设置cookies的方法不符合RFC6265规范问题pr#418@Gitee

View File

@ -1,6 +1,7 @@
package cn.hutool.poi.excel.reader;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.poi.excel.cell.CellEditor;
import org.apache.poi.ss.usermodel.Sheet;
@ -41,8 +42,9 @@ public class BeanSheetReader<T> implements SheetReader<List<T>> {
}
final List<T> beanList = new ArrayList<>(mapList.size());
final CopyOptions copyOptions = CopyOptions.create().setIgnoreError(true);
for (Map<String, Object> map : mapList) {
beanList.add(BeanUtil.toBeanIgnoreError(map, this.beanClass));
beanList.add(BeanUtil.toBean(map, this.beanClass, copyOptions));
}
return beanList;
}