-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: Fix Potential Data Read Failures Caused by Custom Data Format…
…s.by @zyd0131 at #2319
Showing
6 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
fastexcel-test/src/test/java/cn/idev/excel/test/temp/issue2319/Issue2319.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package cn.idev.excel.test.temp.issue2319; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@EqualsAndHashCode | ||
public class Issue2319 { | ||
private String num1; | ||
private String num2; | ||
} |
36 changes: 36 additions & 0 deletions
36
fastexcel-test/src/test/java/cn/idev/excel/test/temp/issue2319/Issue2319Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package cn.idev.excel.test.temp.issue2319; | ||
|
||
import java.io.File; | ||
|
||
import com.alibaba.fastjson2.JSON; | ||
|
||
import cn.idev.excel.EasyExcel; | ||
import cn.idev.excel.FastExcel; | ||
import cn.idev.excel.read.listener.PageReadListener; | ||
import cn.idev.excel.test.util.TestFileUtil; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.jupiter.api.Test; | ||
|
||
@Slf4j | ||
public class Issue2319Test { | ||
@Test | ||
public void IssueTest1() { | ||
String fileName = TestFileUtil.getPath() + "temp/issue2319" + File.separator + "test1.xlsx"; | ||
FastExcel.read(fileName, Issue2319.class, new PageReadListener<Issue2319>(dataList -> { | ||
for (Issue2319 issueData : dataList) { | ||
System.out.println(("读取到一条数据{}" + JSON.toJSONString(issueData))); | ||
} | ||
})).sheet().doRead(); | ||
} | ||
|
||
//CS304 (manually written) Issue link: https://github.com/alibaba/easyexcel/issues/2319 | ||
@Test | ||
public void IssueTest2() { | ||
String fileName = TestFileUtil.getPath() + "temp/issue2319" + File.separator + "test2.xlsx"; | ||
FastExcel.read(fileName, Issue2319.class, new PageReadListener<Issue2319>(dataList -> { | ||
for (Issue2319 issueData : dataList) { | ||
System.out.println(("读取到一条数据{}" + JSON.toJSONString(issueData))); | ||
} | ||
})).sheet().doRead(); | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters