Bug 63158 - sheet.getLastRowNum() and sheet.getRows() are broken
Summary: sheet.getLastRowNum() and sheet.getRows() are broken
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 4.0.0-FINAL
Hardware: PC All
: P2 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
: 63157 (view as bug list)
Depends on:
Reported: 2019-02-08 13:02 UTC by Dzmitry Kliuchnik
Modified: 2019-02-17 06:54 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Dzmitry Kliuchnik 2019-02-08 13:02:43 UTC
sheet.getLastRowNum() and sheet.getRows() are broken

sheet.getLastRowNum() returns actual rows number - 1 (empty rows are not accounted - I's OK)

sheet.getRows() returns all rows except last one
Comment 1 Dzmitry Kliuchnik 2019-02-08 13:04:13 UTC
4.0.1 version
Comment 2 PJ Fanning 2019-02-08 21:16:15 UTC
*** Bug 63157 has been marked as a duplicate of this bug. ***
Comment 3 Yegor Kozlov 2019-02-10 12:34:07 UTC
getLastRowNum() is 0-based and it is reflected in the documentation.

There isn't such a method getRows() in the Sheet interface. Do you mean that iteration over rows skips the last row? I don't think it is so and we have numerous unit tests that prove it. 
If you still think there is a bug, can you please attach a unit test demonstrating the problem?

Comment 4 Dominik Stadler 2019-02-17 06:54:10 UTC
We could not see anything being wrong in Apache POI here and no more information provided for a week, thus I am resolving this as WORKSFORME for now. 

If you still think there is a problem, then please reopen with some code-sample, ideally as self-sufficient unit-test which allows to reproduce your problem so we can see the actual problem more easily.