https://issues.apache.org/bugzilla/show_bug.cgi?id=43901
Josh Micich <[EMAIL PROTECTED]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |WORKSFORME
--- Comment #6 from Josh Micich <[EMAIL PROTECTED]> 2008-03-06 08:31:18 PST ---
(In reply to comment #5)
> I still believe this is a bug. Has it been fixed in the latest release?
I admit I had to read the javadoc twice before I understood what this method
did, but I am convinced the behaviour is correct and intentional.
This method allows standard 'zero based' array iteration (i=0; i<max; i++) over
cells in a row. I have used getLastCellNum() like this, POI internally uses
getLastCellNum() like this, and I'm sure many other POI dependent projects have
done the same. So it's very unlikely that the behaviour can be changed.
The javadoc could be improved a bit. Here is a suggestion:
/**
* Gets the index of the last cell contained in this row <b>PLUS ONE</b>.
The result also
* happens to be the 1-based column number of the last cell. This value
can be used as a
* standard upper bound when iterating over cells:
* <pre>
* int maxColIx = row.getLastCellNum();
* for(short colIx=0; colIx<maxColIx; colIx++) {
* HSSFCell cell = row.getCell(colIx);
* if(cell == null) {
* continue;
* }
* //... do something with cell
* }
* </pre>
*
* @return short representing the last logical cell in the row <b>PLUS
ONE</b>, or -1 if the
* row does not contain any cells.
*/
I'm going to mark this bug as WORKSFORME. If you still think there is a bug,
could you please upload a junit test that shows it.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]