There are two similar methods HSSFSheet.getLastRowNum() and HSSFRow.getLastCellNum() -- they should return the actual location of the last row or cell for the spreadsheet. So for a sheet with 10 rows and 12 columns, the values returned should be 9 (rows) and 11 (columns) as numbering is 0-based. However getLastCellNum() returns the count (ie. 12) instead of the actual location. I had sent out email to the mailing list with a simple program to test this functionality along with a test excel file. Please use those (since it doesnt seem like I can attach files to this bug report). Also note that I tried this only on WinNT but it might be a problem on other platforms as well ??
Created attachment 3971 [details] simple java file to reproduce problem
Created attachment 3972 [details] test excel file
managed to attach the files here. check them out !
*** Bug 15184 has been marked as a duplicate of this bug. ***
This should NOT be changed in a hurry without understanding the implications, since the method is called internally many times. Further, this will be a backward-incompatible change. So, further thougth needed.
I don't think htis is a bug.