Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
金手指1668
easyexcel
提交
927f6b41
E
easyexcel
项目概览
金手指1668
/
easyexcel
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
easyexcel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
927f6b41
编写于
5月 25, 2020
作者:
庄家钜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复xls直接读取第2页 `NPE` 的bug #1280
上级
58fdceb2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
6 deletion
+8
-6
src/main/java/com/alibaba/excel/analysis/v03/handlers/BofRecordHandler.java
...alibaba/excel/analysis/v03/handlers/BofRecordHandler.java
+5
-4
src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java
src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java
+2
-2
update.md
update.md
+1
-0
未找到文件。
src/main/java/com/alibaba/excel/analysis/v03/handlers/BofRecordHandler.java
浏览文件 @
927f6b41
...
@@ -22,7 +22,7 @@ public class BofRecordHandler extends AbstractXlsRecordHandler {
...
@@ -22,7 +22,7 @@ public class BofRecordHandler extends AbstractXlsRecordHandler {
@Override
@Override
public
void
processRecord
(
XlsReadContext
xlsReadContext
,
Record
record
)
{
public
void
processRecord
(
XlsReadContext
xlsReadContext
,
Record
record
)
{
BOFRecord
br
=
(
BOFRecord
)
record
;
BOFRecord
br
=
(
BOFRecord
)
record
;
XlsReadWorkbookHolder
xlsReadWorkbookHolder
=
xlsReadContext
.
xlsReadWorkbookHolder
();
XlsReadWorkbookHolder
xlsReadWorkbookHolder
=
xlsReadContext
.
xlsReadWorkbookHolder
();
if
(
br
.
getType
()
==
BOFRecord
.
TYPE_WORKBOOK
)
{
if
(
br
.
getType
()
==
BOFRecord
.
TYPE_WORKBOOK
)
{
xlsReadWorkbookHolder
.
setReadSheetIndex
(
null
);
xlsReadWorkbookHolder
.
setReadSheetIndex
(
null
);
...
@@ -38,14 +38,15 @@ public class BofRecordHandler extends AbstractXlsRecordHandler {
...
@@ -38,14 +38,15 @@ public class BofRecordHandler extends AbstractXlsRecordHandler {
readSheetIndex
=
0
;
readSheetIndex
=
0
;
xlsReadWorkbookHolder
.
setReadSheetIndex
(
readSheetIndex
);
xlsReadWorkbookHolder
.
setReadSheetIndex
(
readSheetIndex
);
}
}
ReadSheet
r
eadSheet
=
xlsReadWorkbookHolder
.
getActualSheetDataList
().
get
(
readSheetIndex
);
ReadSheet
actualR
eadSheet
=
xlsReadWorkbookHolder
.
getActualSheetDataList
().
get
(
readSheetIndex
);
assert
r
eadSheet
!=
null
:
"Can't find the sheet."
;
assert
actualR
eadSheet
!=
null
:
"Can't find the sheet."
;
// Copy the parameter to the current sheet
// Copy the parameter to the current sheet
readSheet
=
SheetUtils
.
match
(
r
eadSheet
,
xlsReadContext
);
ReadSheet
readSheet
=
SheetUtils
.
match
(
actualR
eadSheet
,
xlsReadContext
);
if
(
readSheet
!=
null
)
{
if
(
readSheet
!=
null
)
{
xlsReadContext
.
currentSheet
(
readSheet
);
xlsReadContext
.
currentSheet
(
readSheet
);
xlsReadContext
.
xlsReadSheetHolder
().
setIgnoreRecord
(
Boolean
.
FALSE
);
xlsReadContext
.
xlsReadSheetHolder
().
setIgnoreRecord
(
Boolean
.
FALSE
);
}
else
{
}
else
{
xlsReadContext
.
currentSheet
(
actualReadSheet
);
xlsReadContext
.
xlsReadSheetHolder
().
setIgnoreRecord
(
Boolean
.
TRUE
);
xlsReadContext
.
xlsReadSheetHolder
().
setIgnoreRecord
(
Boolean
.
TRUE
);
}
}
// Go read the next one
// Go read the next one
...
...
src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java
浏览文件 @
927f6b41
...
@@ -32,9 +32,9 @@ public class Lock2Test {
...
@@ -32,9 +32,9 @@ public class Lock2Test {
@Test
@Test
public
void
test
()
throws
Exception
{
public
void
test
()
throws
Exception
{
File
file
=
TestFileUtil
.
readUserHomeFile
(
"test/test
4.xlsx
"
);
File
file
=
TestFileUtil
.
readUserHomeFile
(
"test/test
6.xls
"
);
List
<
Object
>
list
=
EasyExcel
.
read
(
file
).
sheet
().
headRowNumber
(
0
).
doReadSync
();
List
<
Object
>
list
=
EasyExcel
.
read
(
file
).
sheet
(
1
).
headRowNumber
(
0
).
doReadSync
();
LOGGER
.
info
(
"数据:{}"
,
list
.
size
());
LOGGER
.
info
(
"数据:{}"
,
list
.
size
());
for
(
Object
data
:
list
)
{
for
(
Object
data
:
list
)
{
LOGGER
.
info
(
"返回数据:{}"
,
JSON
.
toJSONString
(
data
));
LOGGER
.
info
(
"返回数据:{}"
,
JSON
.
toJSONString
(
data
));
...
...
update.md
浏览文件 @
927f6b41
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
*
修复多个
`sheet`
不按照顺序写入 会乱序的bug
[
Issue #1332
](
https://github.com/alibaba/easyexcel/issues/1332
)
*
修复多个
`sheet`
不按照顺序写入 会乱序的bug
[
Issue #1332
](
https://github.com/alibaba/easyexcel/issues/1332
)
*
修改head是List时,内容单元格的样式不生效
[
Issue #1339
](
https://github.com/alibaba/easyexcel/issues/1339
)
*
修改head是List时,内容单元格的样式不生效
[
Issue #1339
](
https://github.com/alibaba/easyexcel/issues/1339
)
*
修复xls仅公式行 不读取的bug
[
Issue #1324
](
https://github.com/alibaba/easyexcel/issues/1324
)
*
修复xls仅公式行 不读取的bug
[
Issue #1324
](
https://github.com/alibaba/easyexcel/issues/1324
)
*
修复xls直接读取第2页
`NPE`
的bug
[
Issue #1280
](
https://github.com/alibaba/easyexcel/issues/1280
)
# 2.2.3
# 2.2.3
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录