From 51238868bee9c0f5b3cff35af0089a41590f63a5 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Wed, 28 Aug 2019 16:20:08 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8B=A6=E6=88=AA?= =?UTF-8?q?=E5=99=A8demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quickstart.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/quickstart.md b/quickstart.md index 6312800..f75107a 100644 --- a/quickstart.md +++ b/quickstart.md @@ -853,6 +853,67 @@ public class LongestMatchColumnWidthData { ![img](img/readme/quickstart/write/customHandlerWrite.png) ##### 对象 参照:[对象](#simpleWriteObject) +##### 定义拦截器 +````java +/** + * 自定义拦截器。对第一行第一列的头超链接到:https://github.com/alibaba/easyexcel + * + * @author Jiaju Zhuang + */ +public class CustomCellWriteHandler implements CellWriteHandler { + + private static final Logger LOGGER = LoggerFactory.getLogger(CustomCellWriteHandler.class); + + @Override + public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, + Head head, int relativeRowIndex, boolean isHead) { + + } + + @Override + public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, CellData cellData, + Cell cell, Head head, int relativeRowIndex, boolean isHead) { + // 这里可以对cell进行任何操作 + LOGGER.info("第{}行,第{}列写入完成。", cell.getRowIndex(), cell.getColumnIndex()); + if (isHead && cell.getColumnIndex() == 0) { + CreationHelper createHelper = writeSheetHolder.getSheet().getWorkbook().getCreationHelper(); + Hyperlink hyperlink = createHelper.createHyperlink(HyperlinkType.URL); + hyperlink.setAddress("https://github.com/alibaba/easyexcel"); + cell.setHyperlink(hyperlink); + } + } + +} +```` +````java +/** + * 自定义拦截器.对第一列第一行和第二行的数据新增下拉框,显示 测试1 测试2 + * + * @author Jiaju Zhuang + */ +public class CustomSheetWriteHandler implements SheetWriteHandler { + + private static final Logger LOGGER = LoggerFactory.getLogger(CustomSheetWriteHandler.class); + + @Override + public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) { + + } + + @Override + public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) { + LOGGER.info("第{}个Sheet写入成功。", writeSheetHolder.getSheetNo()); + + // 区间设置 第一列第一行和第二行的数据。由于第一行是头,所以第一、二行的数据实际上是第二三行 + CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(1, 2, 0, 0); + DataValidationHelper helper = writeSheetHolder.getSheet().getDataValidationHelper(); + DataValidationConstraint constraint = helper.createExplicitListConstraint(new String[] {"测试1", "测试2"}); + DataValidation dataValidation = helper.createValidation(constraint, cellRangeAddressList); + writeSheetHolder.getSheet().addValidationData(dataValidation); + } +} + +```` ##### 代码 ```java /** From 1adb06af37c45efecc0dfafe9b7986014eef5ffe Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Wed, 28 Aug 2019 18:37:53 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=B1=BB=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E7=A7=81=E6=9C=89=E6=9E=84=E9=80=A0=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quickstart.md | 2 ++ src/main/java/com/alibaba/excel/metadata/BasicParameter.java | 3 +-- src/main/java/com/alibaba/excel/util/BooleanUtils.java | 2 ++ src/main/java/com/alibaba/excel/util/CollectionUtils.java | 4 +++- src/main/java/com/alibaba/excel/util/FileUtils.java | 2 ++ src/main/java/com/alibaba/excel/util/IoUtils.java | 2 ++ src/main/java/com/alibaba/excel/util/PositionUtils.java | 2 ++ src/main/java/com/alibaba/excel/util/StringUtils.java | 4 +++- src/main/java/com/alibaba/excel/util/StyleUtil.java | 2 ++ src/main/java/com/alibaba/excel/util/WorkBookUtil.java | 2 ++ 10 files changed, 21 insertions(+), 4 deletions(-) diff --git a/quickstart.md b/quickstart.md index f75107a..ca1432e 100644 --- a/quickstart.md +++ b/quickstart.md @@ -1,5 +1,7 @@ # easyexcel核心功能 ## 目录 +### 前言 +读写的对象都用到了[Lombok](https://www.projectlombok.org/),他会自动生成`get`,`set` ,如果不需要自己创建对象并生成`get`,`set` 。 ### 读 DEMO代码地址:[https://github.com/alibaba/easyexcel/blob/master/src/test/java/com/alibaba/easyexcel/demo/read/ReadTest.java](/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java) * [最简单的读](#simpleRead) diff --git a/src/main/java/com/alibaba/excel/metadata/BasicParameter.java b/src/main/java/com/alibaba/excel/metadata/BasicParameter.java index dfcf782..89d7851 100644 --- a/src/main/java/com/alibaba/excel/metadata/BasicParameter.java +++ b/src/main/java/com/alibaba/excel/metadata/BasicParameter.java @@ -1,6 +1,5 @@ package com.alibaba.excel.metadata; -import java.util.ArrayList; import java.util.List; import com.alibaba.excel.converters.Converter; @@ -22,7 +21,7 @@ public class BasicParameter { /** * Custom type conversions override the default */ - private List customConverterList = new ArrayList(); + private List customConverterList; /** * Automatic trim includes sheet name and content */ diff --git a/src/main/java/com/alibaba/excel/util/BooleanUtils.java b/src/main/java/com/alibaba/excel/util/BooleanUtils.java index afd1495..c09506b 100644 --- a/src/main/java/com/alibaba/excel/util/BooleanUtils.java +++ b/src/main/java/com/alibaba/excel/util/BooleanUtils.java @@ -10,6 +10,8 @@ public class BooleanUtils { private static final String TRUE_NUMBER = "1"; private static final String FALSE_NUMBER = "0"; + private BooleanUtils() {} + /** * String to boolean * diff --git a/src/main/java/com/alibaba/excel/util/CollectionUtils.java b/src/main/java/com/alibaba/excel/util/CollectionUtils.java index fff57ff..f413be1 100644 --- a/src/main/java/com/alibaba/excel/util/CollectionUtils.java +++ b/src/main/java/com/alibaba/excel/util/CollectionUtils.java @@ -5,11 +5,13 @@ import java.util.Map; /** * Collection utils - * + * * @author jipengfei */ public class CollectionUtils { + private CollectionUtils() {} + public static boolean isEmpty(Collection collection) { return (collection == null || collection.isEmpty()); } diff --git a/src/main/java/com/alibaba/excel/util/FileUtils.java b/src/main/java/com/alibaba/excel/util/FileUtils.java index 717ddfe..9738b50 100644 --- a/src/main/java/com/alibaba/excel/util/FileUtils.java +++ b/src/main/java/com/alibaba/excel/util/FileUtils.java @@ -25,6 +25,8 @@ public class FileUtils { private static final String CACHE = "excache"; private static final int WRITE_BUFF_SIZE = 8192; + private FileUtils() {} + /** * Reads the contents of a file into a byte array. * The file is always closed. * diff --git a/src/main/java/com/alibaba/excel/util/IoUtils.java b/src/main/java/com/alibaba/excel/util/IoUtils.java index 9405c91..d590511 100644 --- a/src/main/java/com/alibaba/excel/util/IoUtils.java +++ b/src/main/java/com/alibaba/excel/util/IoUtils.java @@ -17,6 +17,8 @@ public class IoUtils { */ private static final int DEFAULT_BUFFER_SIZE = 1024 * 4; + private IoUtils() {} + /** * Gets the contents of an InputStream as a byte[]. * diff --git a/src/main/java/com/alibaba/excel/util/PositionUtils.java b/src/main/java/com/alibaba/excel/util/PositionUtils.java index 3151040..090bbdf 100644 --- a/src/main/java/com/alibaba/excel/util/PositionUtils.java +++ b/src/main/java/com/alibaba/excel/util/PositionUtils.java @@ -5,6 +5,8 @@ package com.alibaba.excel.util; */ public class PositionUtils { + private PositionUtils() {} + public static int getRow(String currentCellIndex) { int row = 0; if (currentCellIndex != null) { diff --git a/src/main/java/com/alibaba/excel/util/StringUtils.java b/src/main/java/com/alibaba/excel/util/StringUtils.java index 8210a19..25ed127 100644 --- a/src/main/java/com/alibaba/excel/util/StringUtils.java +++ b/src/main/java/com/alibaba/excel/util/StringUtils.java @@ -2,11 +2,13 @@ package com.alibaba.excel.util; /** * String utils - * + * * @author jipengfei */ public class StringUtils { + private StringUtils() {} + public static boolean isEmpty(Object str) { return (str == null || "".equals(str)); } diff --git a/src/main/java/com/alibaba/excel/util/StyleUtil.java b/src/main/java/com/alibaba/excel/util/StyleUtil.java index 3031048..d0e1bd3 100644 --- a/src/main/java/com/alibaba/excel/util/StyleUtil.java +++ b/src/main/java/com/alibaba/excel/util/StyleUtil.java @@ -17,6 +17,8 @@ import com.alibaba.excel.write.metadata.style.WriteFont; */ public class StyleUtil { + private StyleUtil() {} + /** * @param workbook * @return diff --git a/src/main/java/com/alibaba/excel/util/WorkBookUtil.java b/src/main/java/com/alibaba/excel/util/WorkBookUtil.java index 1fa7834..b9579b1 100644 --- a/src/main/java/com/alibaba/excel/util/WorkBookUtil.java +++ b/src/main/java/com/alibaba/excel/util/WorkBookUtil.java @@ -22,6 +22,8 @@ import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; */ public class WorkBookUtil { + private WorkBookUtil() {} + public static Workbook createWorkBook(WriteWorkbookHolder writeWorkbookHolder) throws IOException, InvalidFormatException { if (ExcelTypeEnum.XLSX.equals(writeWorkbookHolder.getExcelType())) { From d1dce03670c470ec7641464303c7a3fad828aab3 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Thu, 29 Aug 2019 18:38:09 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=88?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quickstart.md | 6 ++++++ update.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/quickstart.md b/quickstart.md index ca1432e..7098784 100644 --- a/quickstart.md +++ b/quickstart.md @@ -1,7 +1,13 @@ # easyexcel核心功能 ## 目录 ### 前言 +#### 关于@Data 读写的对象都用到了[Lombok](https://www.projectlombok.org/),他会自动生成`get`,`set` ,如果不需要自己创建对象并生成`get`,`set` 。 +#### 以下功能目前不支持 +* 单个文件的并发写入、读取 +* 读取图片 +* 宏 +#### 开源项目不容易,如果觉得本项目对您的工作还是有帮助的话,请在右上角帮忙点个★Star。 ### 读 DEMO代码地址:[https://github.com/alibaba/easyexcel/blob/master/src/test/java/com/alibaba/easyexcel/demo/read/ReadTest.java](/src/test/java/com/alibaba/easyexcel/test/demo/read/ReadTest.java) * [最简单的读](#simpleRead) diff --git a/update.md b/update.md index 12a2f85..ec03f86 100644 --- a/update.md +++ b/update.md @@ -1,4 +1,4 @@ -# 2.0.0 +# 2.0.0-beta1 * 优化读写逻辑 * 优化读写对外接口 * 加入转换器,方便格式转换 From 76282573d6900b3d17101be49998e7d3270d47e5 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Thu, 29 Aug 2019 19:46:36 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=B5=81=E9=9C=80=E8=A6=81gc=E6=89=8D=E8=83=BD=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E7=9A=84=E9=97=AE=E9=A2=98=20#511?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../excel/analysis/ExcelAnalyserImpl.java | 14 +++++ .../excel/analysis/v03/XlsSaxAnalyser.java | 1 + .../excel/analysis/v07/XlsxSaxAnalyser.java | 1 + .../metadata/holder/ReadWorkbookHolder.java | 26 +++++++++ .../easyexcel/test/temp/Lock2Test.java | 54 +++++++++++++++++++ .../easyexcel/test/temp/poi/Poi2Test.java | 50 +++++++++++++++++ update.md | 3 ++ 8 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi2Test.java diff --git a/pom.xml b/pom.xml index f85fd40..0e5b790 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.alibaba easyexcel - 2.0.0-beta1 + 2.0.0-beta2 jar easyexcel diff --git a/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java b/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java index dcf1d84..256fb51 100644 --- a/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java +++ b/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java @@ -131,6 +131,20 @@ public class ExcelAnalyserImpl implements ExcelAnalyser { } catch (Throwable e) { throw new ExcelAnalysisException("Can not close IO", e); } + try { + if (readWorkbookHolder.getOpcPackage() != null) { + readWorkbookHolder.getOpcPackage().close(); + } + } catch (Throwable e) { + throw new ExcelAnalysisException("Can not close IO", e); + } + try { + if (readWorkbookHolder.getPoifsFileSystem() != null) { + readWorkbookHolder.getPoifsFileSystem().close(); + } + } catch (Throwable e) { + throw new ExcelAnalysisException("Can not close IO", e); + } } @Override diff --git a/src/main/java/com/alibaba/excel/analysis/v03/XlsSaxAnalyser.java b/src/main/java/com/alibaba/excel/analysis/v03/XlsSaxAnalyser.java index 996e33a..2b67b43 100644 --- a/src/main/java/com/alibaba/excel/analysis/v03/XlsSaxAnalyser.java +++ b/src/main/java/com/alibaba/excel/analysis/v03/XlsSaxAnalyser.java @@ -73,6 +73,7 @@ public class XlsSaxAnalyser implements HSSFListener, ExcelExecutor { this.analysisContext = context; this.records = new TreeMap(); this.poifsFileSystem = poifsFileSystem; + analysisContext.readWorkbookHolder().setPoifsFileSystem(poifsFileSystem); } @Override diff --git a/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java b/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java index 748306a..f16f926 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/XlsxSaxAnalyser.java @@ -59,6 +59,7 @@ public class XlsxSaxAnalyser implements ExcelExecutor { ReadWorkbookHolder readWorkbookHolder = analysisContext.readWorkbookHolder(); OPCPackage pkg = readOpcPackage(readWorkbookHolder, decryptedStream); + readWorkbookHolder.setOpcPackage(pkg); PackagePart sharedStringsTablePackagePart = pkg.getPartsByContentType(XSSFRelation.SHARED_STRINGS.getContentType()).get(0); diff --git a/src/main/java/com/alibaba/excel/read/metadata/holder/ReadWorkbookHolder.java b/src/main/java/com/alibaba/excel/read/metadata/holder/ReadWorkbookHolder.java index bfcc050..9b77c8c 100644 --- a/src/main/java/com/alibaba/excel/read/metadata/holder/ReadWorkbookHolder.java +++ b/src/main/java/com/alibaba/excel/read/metadata/holder/ReadWorkbookHolder.java @@ -6,6 +6,8 @@ import java.io.InputStream; import java.util.HashSet; import java.util.Set; +import org.apache.poi.openxml4j.opc.OPCPackage; +import org.apache.poi.poifs.filesystem.POIFSFileSystem; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -90,6 +92,14 @@ public class ReadWorkbookHolder extends AbstractReadHolder { * Prevent repeating sheet */ private Set hasReadSheet; + /** + * Package + */ + private OPCPackage opcPackage; + /** + * File System + */ + private POIFSFileSystem poifsFileSystem; public ReadWorkbookHolder(ReadWorkbook readWorkbook) { super(readWorkbook, null, readWorkbook.getConvertAllFiled()); @@ -232,6 +242,22 @@ public class ReadWorkbookHolder extends AbstractReadHolder { this.defaultReturnMap = defaultReturnMap; } + public OPCPackage getOpcPackage() { + return opcPackage; + } + + public void setOpcPackage(OPCPackage opcPackage) { + this.opcPackage = opcPackage; + } + + public POIFSFileSystem getPoifsFileSystem() { + return poifsFileSystem; + } + + public void setPoifsFileSystem(POIFSFileSystem poifsFileSystem) { + this.poifsFileSystem = poifsFileSystem; + } + @Override public HolderEnum holderType() { return HolderEnum.WORKBOOK; diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java b/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java new file mode 100644 index 0000000..dd89105 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java @@ -0,0 +1,54 @@ +package com.alibaba.easyexcel.test.temp; + +import java.io.File; +import java.io.FileInputStream; +import java.util.List; + +import org.junit.Ignore; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.support.ExcelTypeEnum; +import com.alibaba.fastjson.JSON; + +/** + * 临时测试 + * + * @author Jiaju Zhuang + **/ +@Ignore +public class Lock2Test { + private static final Logger LOGGER = LoggerFactory.getLogger(Lock2Test.class); + + @Test + public void test() throws Exception { + File file = new File("D:\\test\\珠海2.xlsx"); + + List list = EasyExcel.read(file).sheet().headRowNumber(0).doReadSync(); + LOGGER.info("数据:{}", list.size()); + for (Object data : list) { + LOGGER.info("返回数据:{}", JSON.toJSONString(data)); + } + LOGGER.info("文件状态:{}", file.exists()); + file.delete(); + Thread.sleep(500 * 1000); + } + + @Test + public void test2() throws Exception { + File file = new File("D:\\test\\converter03.xls"); + + List list = EasyExcel.read(file).sheet().headRowNumber(0).doReadSync(); + LOGGER.info("数据:{}", list.size()); + for (Object data : list) { + LOGGER.info("返回数据:{}", JSON.toJSONString(data)); + } + LOGGER.info("文件状态:{}", file.exists()); + file.delete(); + Thread.sleep(500 * 1000); + } + + +} diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi2Test.java b/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi2Test.java new file mode 100644 index 0000000..0de7d9e --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/temp/poi/Poi2Test.java @@ -0,0 +1,50 @@ +package com.alibaba.easyexcel.test.temp.poi; + +import java.io.File; +import java.io.IOException; + +import org.apache.poi.xssf.streaming.SXSSFRow; +import org.apache.poi.xssf.streaming.SXSSFSheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.junit.Ignore; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.alibaba.easyexcel.test.util.TestFileUtil; + +/** + * 测试poi + * + * @author Jiaju Zhuang + **/ +@Ignore +public class Poi2Test { + private static final Logger LOGGER = LoggerFactory.getLogger(Poi2Test.class); + + @Test + public void test() throws IOException { + String file = "D:\\test\\珠海.xlsx"; + SXSSFWorkbook xssfWorkbook = new SXSSFWorkbook(new XSSFWorkbook(file)); + SXSSFSheet xssfSheet = xssfWorkbook.getSheetAt(0); + LOGGER.info("一共行数:{}", xssfSheet.getLastRowNum()); + SXSSFRow row = xssfSheet.getRow(0); + LOGGER.info("第一行数据:{}", row); + } + + @Test + public void lastRowNumXSSF() throws IOException { + String file = "D:\\test\\珠海.xlsx"; + XSSFWorkbook xssfWorkbook = new XSSFWorkbook(file); + LOGGER.info("一共:{}个sheet", xssfWorkbook.getNumberOfSheets()); + XSSFSheet xssfSheet = xssfWorkbook.getSheetAt(0); + LOGGER.info("一共行数:{}", xssfSheet.getLastRowNum()); + XSSFRow row = xssfSheet.getRow(0); + LOGGER.info("第一行数据:{}", row); + xssfSheet.createRow(20); + LOGGER.info("一共行数:{}", xssfSheet.getLastRowNum()); + } +} diff --git a/update.md b/update.md index ec03f86..b1f7107 100644 --- a/update.md +++ b/update.md @@ -1,3 +1,6 @@ +# 2.0.0-beta2 +* 加速gc回收 #511 + # 2.0.0-beta1 * 优化读写逻辑 * 优化读写对外接口 From e58a6835bcd80802385b1239a041ae62c56309e7 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Thu, 29 Aug 2019 19:54:02 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=B5=81=E9=9C=80=E8=A6=81gc=E6=89=8D=E8=83=BD=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E7=9A=84=E9=97=AE=E9=A2=98=20#511?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/analysis/ExcelAnalyserImpl.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java b/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java index 256fb51..d21b8db 100644 --- a/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java +++ b/src/main/java/com/alibaba/excel/analysis/ExcelAnalyserImpl.java @@ -117,30 +117,30 @@ public class ExcelAnalyserImpl implements ExcelAnalyser { throw new ExcelAnalysisException("Can not close IO", e); } try { - if (analysisContext.readWorkbookHolder().getAutoCloseStream() - && readWorkbookHolder.getInputStream() != null) { - readWorkbookHolder.getInputStream().close(); + if (readWorkbookHolder.getOpcPackage() != null) { + readWorkbookHolder.getOpcPackage().close(); } } catch (Throwable e) { throw new ExcelAnalysisException("Can not close IO", e); } try { - if (readWorkbookHolder.getTempFile() != null) { - FileUtils.delete(readWorkbookHolder.getTempFile()); + if (readWorkbookHolder.getPoifsFileSystem() != null) { + readWorkbookHolder.getPoifsFileSystem().close(); } } catch (Throwable e) { throw new ExcelAnalysisException("Can not close IO", e); } try { - if (readWorkbookHolder.getOpcPackage() != null) { - readWorkbookHolder.getOpcPackage().close(); + if (analysisContext.readWorkbookHolder().getAutoCloseStream() + && readWorkbookHolder.getInputStream() != null) { + readWorkbookHolder.getInputStream().close(); } } catch (Throwable e) { throw new ExcelAnalysisException("Can not close IO", e); } try { - if (readWorkbookHolder.getPoifsFileSystem() != null) { - readWorkbookHolder.getPoifsFileSystem().close(); + if (readWorkbookHolder.getTempFile() != null) { + FileUtils.delete(readWorkbookHolder.getTempFile()); } } catch (Throwable e) { throw new ExcelAnalysisException("Can not close IO", e); From 0b78e6e9fd649d9ffcaa4833e0cebbfe9ff6ed6a Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Thu, 29 Aug 2019 20:03:37 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=B5=81=E9=9C=80=E8=A6=81gc=E6=89=8D=E8=83=BD=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E7=9A=84=E9=97=AE=E9=A2=98=20#511?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.md b/update.md index b1f7107..2bae274 100644 --- a/update.md +++ b/update.md @@ -1,5 +1,5 @@ # 2.0.0-beta2 -* 加速gc回收 #511 +* 加速gc回收 [Issue #511](https://github.com/alibaba/easyexcel/issues/511) # 2.0.0-beta1 * 优化读写逻辑 From e0d718b0ab9b789720c026e339832dedf28d1e1e Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 30 Aug 2019 12:21:01 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A9=BA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E8=AF=BB=E5=8F=96=E5=8F=AF=E8=83=BD=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v07/SharedStringsTableHandler.java | 14 ++++-- .../easyexcel/test/temp/Lock2Test.java | 19 +++++-- .../alibaba/easyexcel/test/temp/LockData.java | 22 ++++++++ .../easyexcel/test/temp/LockDataListener.java | 50 +++++++++++++++++++ 4 files changed, 97 insertions(+), 8 deletions(-) create mode 100644 src/test/java/com/alibaba/easyexcel/test/temp/LockData.java create mode 100644 src/test/java/com/alibaba/easyexcel/test/temp/LockDataListener.java diff --git a/src/main/java/com/alibaba/excel/analysis/v07/SharedStringsTableHandler.java b/src/main/java/com/alibaba/excel/analysis/v07/SharedStringsTableHandler.java index 9d228d2..b4d9177 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/SharedStringsTableHandler.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/SharedStringsTableHandler.java @@ -30,15 +30,23 @@ public class SharedStringsTableHandler extends DefaultHandler { @Override public void startElement(String uri, String localName, String name, Attributes attributes) { - if (SI_TAG.equals(name)) { - currentData = ""; + if (T_TAG.equals(name)) { + currentElementData = null; + } else if (SI_TAG.equals(name)) { + currentData = null; } } @Override public void endElement(String uri, String localName, String name) { if (T_TAG.equals(name)) { - currentData += currentElementData; + if (currentData == null) { + currentData = currentElementData; + } else { + if (currentElementData != null) { + currentData += currentElementData; + } + } } else if (SI_TAG.equals(name)) { readCache.put(currentData); } diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java b/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java index dd89105..cba9bae 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java @@ -9,7 +9,12 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.alibaba.easyexcel.test.demo.read.DemoData; +import com.alibaba.easyexcel.test.demo.read.DemoDataListener; +import com.alibaba.easyexcel.test.util.TestFileUtil; import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.read.metadata.ReadSheet; import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.fastjson.JSON; @@ -24,16 +29,21 @@ public class Lock2Test { @Test public void test() throws Exception { - File file = new File("D:\\test\\珠海2.xlsx"); + File file = new File("D:\\test\\test001.xlsx"); List list = EasyExcel.read(file).sheet().headRowNumber(0).doReadSync(); LOGGER.info("数据:{}", list.size()); for (Object data : list) { LOGGER.info("返回数据:{}", JSON.toJSONString(data)); } - LOGGER.info("文件状态:{}", file.exists()); - file.delete(); - Thread.sleep(500 * 1000); + } + + @Test + public void simpleRead() { + // 写法1: + String fileName = "D:\\test\\珠海 (1).xlsx"; + // 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭 + EasyExcel.read(fileName, LockData.class, new LockDataListener()).sheet().doRead(); } @Test @@ -50,5 +60,4 @@ public class Lock2Test { Thread.sleep(500 * 1000); } - } diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/LockData.java b/src/test/java/com/alibaba/easyexcel/test/temp/LockData.java new file mode 100644 index 0000000..2e1ed7b --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/temp/LockData.java @@ -0,0 +1,22 @@ +package com.alibaba.easyexcel.test.temp; + +import lombok.Data; + +/** + * 基础数据类.这里的排序和excel里面的排序一致 + * + * @author Jiaju Zhuang + **/ +@Data +public class LockData { + private String string0; + private String string1; + private String string2; + private String string3; + private String string4; + private String string5; + private String string6; + private String string7; + private String string8; + +} diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/LockDataListener.java b/src/test/java/com/alibaba/easyexcel/test/temp/LockDataListener.java new file mode 100644 index 0000000..bda277c --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/temp/LockDataListener.java @@ -0,0 +1,50 @@ +package com.alibaba.easyexcel.test.temp; + +import java.util.ArrayList; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.alibaba.easyexcel.test.demo.read.DemoDataListener; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; + +/** + * 模板的读取类 + * + * @author Jiaju Zhuang + */ +public class LockDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(DemoDataListener.class); + /** + * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 + */ + private static final int BATCH_COUNT = 5; + List list = new ArrayList(); + + @Override + public void invoke(LockData data, AnalysisContext context) { + LOGGER.info("解析到一条数据:{}", JSON.toJSONString(data)); + list.add(data); + if (list.size() >= BATCH_COUNT) { + saveData(); + list.clear(); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + saveData(); + LOGGER.info("所有数据解析完成!"); + } + + /** + * 加上存储数据库 + */ + private void saveData() { + LOGGER.info("{}条数据,开始存储数据库!", list.size()); + LOGGER.info("存储数据库成功!"); + } +} From 8dbb7ab732451587e3a8fe272c9b04d8d9895bc2 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 30 Aug 2019 12:22:15 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A9=BA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E8=AF=BB=E5=8F=96=E5=8F=AF=E8=83=BD=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E4=B8=8A=E4=B8=AA=E5=AD=97=E6=AE=B5=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update.md | 1 + 1 file changed, 1 insertion(+) diff --git a/update.md b/update.md index 2bae274..c5ee973 100644 --- a/update.md +++ b/update.md @@ -1,5 +1,6 @@ # 2.0.0-beta2 * 加速gc回收 [Issue #511](https://github.com/alibaba/easyexcel/issues/511) +* 修改空字符串读取可能读取上个字段的数据的bug # 2.0.0-beta1 * 优化读写逻辑 From 13956040933ffda6aa9e0415097881327a9379f8 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Fri, 30 Aug 2019 13:38:16 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A9=BA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E8=AF=BB=E5=8F=96=E5=8F=AF=E8=83=BD=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E4=B8=8A=E4=B8=AA=E5=AD=97=E6=AE=B5=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/analysis/v03/XlsSaxAnalyser.java | 1 + .../v07/handlers/DefaultCellHandler.java | 2 ++ .../com/alibaba/excel/metadata/CellData.java | 25 +++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/src/main/java/com/alibaba/excel/analysis/v03/XlsSaxAnalyser.java b/src/main/java/com/alibaba/excel/analysis/v03/XlsSaxAnalyser.java index 2b67b43..a5072a1 100644 --- a/src/main/java/com/alibaba/excel/analysis/v03/XlsSaxAnalyser.java +++ b/src/main/java/com/alibaba/excel/analysis/v03/XlsSaxAnalyser.java @@ -131,6 +131,7 @@ public class XlsSaxAnalyser implements HSSFListener, ExcelExecutor { thisColumn = handler.getColumn(); cellData = handler.getCellData(); if (cellData != null) { + cellData.checkEmpty(); records.put(thisColumn, cellData); } break; diff --git a/src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java b/src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java index 671693b..0ee8ab3 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/handlers/DefaultCellHandler.java @@ -120,6 +120,7 @@ public class DefaultCellHandler implements XlsxCellHandler, XlsxRowResultHolder } else if (currentCellData.getType() == CellDataTypeEnum.DIRECT_STRING) { currentCellData.setType(CellDataTypeEnum.STRING); } + currentCellData.checkEmpty(); curRowContent.put(curCol, currentCellData); } // This is a special form of string @@ -130,6 +131,7 @@ public class DefaultCellHandler implements XlsxCellHandler, XlsxRowResultHolder stringValue = stringValue.trim(); } currentCellData.setStringValue(stringValue); + currentCellData.checkEmpty(); curRowContent.put(curCol, currentCellData); } } diff --git a/src/main/java/com/alibaba/excel/metadata/CellData.java b/src/main/java/com/alibaba/excel/metadata/CellData.java index db73ce8..adfb091 100644 --- a/src/main/java/com/alibaba/excel/metadata/CellData.java +++ b/src/main/java/com/alibaba/excel/metadata/CellData.java @@ -168,6 +168,31 @@ public class CellData { this.dataFormatString = dataFormatString; } + /** + * Ensure that the object does not appear null + */ + public void checkEmpty() { + switch (type) { + case STRING: + case ERROR: + if (stringValue == null) { + type = CellDataTypeEnum.EMPTY; + } + return; + case NUMBER: + if (doubleValue == null) { + type = CellDataTypeEnum.EMPTY; + } + return; + case BOOLEAN: + if (booleanValue == null) { + type = CellDataTypeEnum.EMPTY; + } + return; + default: + } + } + @Override public String toString() { switch (type) { From 4980ee915358f1d010eb76d1604362ea3d0f0f1d Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Mon, 2 Sep 2019 09:54:43 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=A0=E6=B3=95=E8=AF=BB=E5=8F=96=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v07/SharedStringsTableHandler.java | 24 +++++++---- .../metadata/property/ExcelHeadProperty.java | 4 +- .../easyexcel/test/temp/simple/HgTest.java | 42 +++++++++++++++++++ update.md | 1 + 4 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java diff --git a/src/main/java/com/alibaba/excel/analysis/v07/SharedStringsTableHandler.java b/src/main/java/com/alibaba/excel/analysis/v07/SharedStringsTableHandler.java index b4d9177..cca10f6 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/SharedStringsTableHandler.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/SharedStringsTableHandler.java @@ -16,11 +16,11 @@ public class SharedStringsTableHandler extends DefaultHandler { /** * The final piece of data */ - private String currentData; + private StringBuilder currentData; /** * Current element data */ - private String currentElementData; + private StringBuilder currentElementData; private ReadCache readCache; @@ -40,20 +40,26 @@ public class SharedStringsTableHandler extends DefaultHandler { @Override public void endElement(String uri, String localName, String name) { if (T_TAG.equals(name)) { - if (currentData == null) { - currentData = currentElementData; - } else { - if (currentElementData != null) { - currentData += currentElementData; + if (currentElementData != null) { + if (currentData == null) { + currentData = new StringBuilder(); } + currentData.append(currentElementData); } } else if (SI_TAG.equals(name)) { - readCache.put(currentData); + if (currentData == null) { + readCache.put(null); + } else { + readCache.put(currentData.toString()); + } } } @Override public void characters(char[] ch, int start, int length) { - currentElementData = new String(ch, start, length); + if (currentElementData == null) { + currentElementData = new StringBuilder(); + } + currentElementData.append(new String(ch, start, length)); } } diff --git a/src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java b/src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java index 2f117e1..a1200d5 100644 --- a/src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java +++ b/src/main/java/com/alibaba/excel/metadata/property/ExcelHeadProperty.java @@ -137,8 +137,8 @@ public class ExcelHeadProperty { continue; } if (customFiledMap.containsKey(excelProperty.index())) { - throw new ExcelGenerateException("The index of " + customFiledMap.get(excelProperty.index()).getName() - + " and " + field.getName() + " must be inconsistent"); + throw new ExcelGenerateException("The index of '" + customFiledMap.get(excelProperty.index()).getName() + + "' and '" + field.getName() + "' must be inconsistent"); } customFiledMap.put(excelProperty.index(), field); } diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java b/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java new file mode 100644 index 0000000..f5c33a2 --- /dev/null +++ b/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java @@ -0,0 +1,42 @@ +package com.alibaba.easyexcel.test.temp.simple; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.List; + +import org.apache.poi.xssf.streaming.SXSSFRow; +import org.apache.poi.xssf.streaming.SXSSFSheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.junit.Ignore; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.alibaba.easyexcel.test.temp.poi.PoiTest; +import com.alibaba.easyexcel.test.util.TestFileUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.fastjson.JSON; + +/** + * 测试poi + * + * @author Jiaju Zhuang + **/ +@Ignore +public class HgTest { + private static final Logger LOGGER = LoggerFactory.getLogger(HgTest.class); + + @Test + public void hh() throws IOException { + List list = + EasyExcel.read(new FileInputStream("D:\\test\\hg2.xlsx")).sheet().headRowNumber(0).doReadSync(); + for (Object data : list) { + LOGGER.info("返回数据:{}", JSON.toJSONString(data)); + } + } + +} diff --git a/update.md b/update.md index c5ee973..0282227 100644 --- a/update.md +++ b/update.md @@ -1,6 +1,7 @@ # 2.0.0-beta2 * 加速gc回收 [Issue #511](https://github.com/alibaba/easyexcel/issues/511) * 修改空字符串读取可能读取上个字段的数据的bug +* 修改换行数据无法读取的bug # 2.0.0-beta1 * 优化读写逻辑 From 71a341c05b660f70b8956736382e7df0cc88d760 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Mon, 2 Sep 2019 10:13:48 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8=E7=A9=BA?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E7=9A=84=E6=97=B6=E5=80=99=20?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=BD=AC=E6=8D=A2=E5=BC=82=E5=B8=B8=20#520?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/alibaba/excel/metadata/CellData.java | 3 ++- .../alibaba/easyexcel/test/temp/simple/HgTest.java | 13 ++----------- update.md | 1 + 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/alibaba/excel/metadata/CellData.java b/src/main/java/com/alibaba/excel/metadata/CellData.java index adfb091..0a1ffeb 100644 --- a/src/main/java/com/alibaba/excel/metadata/CellData.java +++ b/src/main/java/com/alibaba/excel/metadata/CellData.java @@ -1,6 +1,7 @@ package com.alibaba.excel.metadata; import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.util.StringUtils; /** * Excel internal cell data @@ -175,7 +176,7 @@ public class CellData { switch (type) { case STRING: case ERROR: - if (stringValue == null) { + if (StringUtils.isEmpty(stringValue)) { type = CellDataTypeEnum.EMPTY; } return; diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java b/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java index f5c33a2..17e22de 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/simple/HgTest.java @@ -1,23 +1,14 @@ package com.alibaba.easyexcel.test.temp.simple; -import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.List; -import org.apache.poi.xssf.streaming.SXSSFRow; -import org.apache.poi.xssf.streaming.SXSSFSheet; -import org.apache.poi.xssf.streaming.SXSSFWorkbook; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.alibaba.easyexcel.test.temp.poi.PoiTest; -import com.alibaba.easyexcel.test.util.TestFileUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSON; @@ -32,8 +23,8 @@ public class HgTest { @Test public void hh() throws IOException { - List list = - EasyExcel.read(new FileInputStream("D:\\test\\hg2.xlsx")).sheet().headRowNumber(0).doReadSync(); + List list = EasyExcel.read(new FileInputStream("D:\\test\\hg2.xlsx")).autoTrim(Boolean.FALSE).sheet() + .headRowNumber(0).doReadSync(); for (Object data : list) { LOGGER.info("返回数据:{}", JSON.toJSONString(data)); } diff --git a/update.md b/update.md index 0282227..1062aeb 100644 --- a/update.md +++ b/update.md @@ -2,6 +2,7 @@ * 加速gc回收 [Issue #511](https://github.com/alibaba/easyexcel/issues/511) * 修改空字符串读取可能读取上个字段的数据的bug * 修改换行数据无法读取的bug +* 修复在空字符串的时候 格式转换异常 [Issue #520](https://github.com/alibaba/easyexcel/issues/520) # 2.0.0-beta1 * 优化读写逻辑 From fc8f73b676d9b80acf17741851acbba51c0fc8a7 Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Mon, 2 Sep 2019 10:51:02 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.md b/update.md index 1062aeb..7f672d5 100644 --- a/update.md +++ b/update.md @@ -1,7 +1,7 @@ # 2.0.0-beta2 * 加速gc回收 [Issue #511](https://github.com/alibaba/easyexcel/issues/511) * 修改空字符串读取可能读取上个字段的数据的bug -* 修改换行数据无法读取的bug +* 修改换行数据无法读取的bug [Issue #521](https://github.com/alibaba/easyexcel/issues/521) * 修复在空字符串的时候 格式转换异常 [Issue #520](https://github.com/alibaba/easyexcel/issues/520) # 2.0.0-beta1