From 6448d5aef5e2b8ef6a4b8ae704f676059ecff192 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 29 Oct 2021 20:13:01 +0800 Subject: [PATCH] =?UTF-8?q?*=20=E4=BF=AE=E5=A4=8D`CellData`=E6=8E=A5?= =?UTF-8?q?=E6=94=B6=E5=A4=B1=E8=B4=A5=E7=9A=84=E7=9A=84bug=20[Issue=20#21?= =?UTF-8?q?47]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/alibaba/excel/util/ConverterUtils.java | 3 ++- update.md | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/alibaba/excel/util/ConverterUtils.java b/src/main/java/com/alibaba/excel/util/ConverterUtils.java index 2a30c57c..02ea4a00 100644 --- a/src/main/java/com/alibaba/excel/util/ConverterUtils.java +++ b/src/main/java/com/alibaba/excel/util/ConverterUtils.java @@ -13,6 +13,7 @@ import com.alibaba.excel.converters.NullableObjectConverter; import com.alibaba.excel.converters.ReadConverterContext; import com.alibaba.excel.enums.CellDataTypeEnum; import com.alibaba.excel.exception.ExcelDataConvertException; +import com.alibaba.excel.metadata.data.CellData; import com.alibaba.excel.metadata.data.ReadCellData; import com.alibaba.excel.metadata.property.ExcelContentProperty; import com.alibaba.excel.read.metadata.holder.ReadSheetHolder; @@ -89,7 +90,7 @@ public class ConverterUtils { } else { clazz = field.getType(); } - if (clazz == ReadCellData.class) { + if (clazz == CellData.class || clazz == ReadCellData.class) { Class classGeneric = getClassGeneric(field.getGenericType()); ReadCellData cellDataReturn = cellData.clone(); cellDataReturn.setData(doConvertToJavaObject(cellData, classGeneric, contentProperty, converterMap, diff --git a/update.md b/update.md index 0ac5c924..f1f90470 100644 --- a/update.md +++ b/update.md @@ -1,6 +1,8 @@ # 3.0.2 * 大幅提升读写性能 * 修复列宽注解没用的bug [Issue #2151](https://github.com/alibaba/easyexcel/issues/2151) +* 修复`CellData`接收失败的的bug [Issue #2147](https://github.com/alibaba/easyexcel/issues/2147) + # 3.0.1 * 升级到正式版