The method getLastCellNum of class HSSFRow does not return the index of the last cell contained in this row as described in the documentation but it returns the last index of the row with most cells. If this is wanted so please change the documentation.
There's no mistake in the javadoc for HSSFRow.getLastCellNum() (see bug 43901). So if there is a discrepancy, it's a real bug. From what I understand, you are saying that presence of cells in one row can affect the LastCellNum value of another row. POI didn't seem to have any test case which made sure this doesn't occur, this so I added one (in svn r655912). Can you please upload a spreadsheet and/or some test code which shows the behaviour you are referring to?