You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by "Andrew C. Oliver" <ac...@buni.org> on 2007/03/02 04:48:30 UTC

Arrays and DBCELL

There are some really goofy coding errors in the DBCELL stuff.  Moreover 
I'm unclear as to why we needed to use real arrays rather than ArrayList 
(which wraps an array and yet grows it geometrically if needed).  I 
believe the last "let's drop support for" was 1.3 (meaning presently POI 
is 1.4.x and later) so maybe type safety is a good argument.

Demonstration of "really goofy coding error"

     public boolean rowHasCells(int row) {
-       if (row > records.length)
-               return false;
-      CellValueRecordInterface[] rowCells=records[row];


What if records.length is 69 and the row passed is 69? 

ArrayIndexOutOfBounds exception is what happens! 

Now that there aren't failing unit tests says that we're missing some 
key test cases because any sheet that exercises this will cause an 
AOOBE.  I will ask our support customer if we can supply their sheet as 
a test case.

But geesh guys this is a pretty serious QA issue.  What can kinds of 
things can we do to keep code like this from making it into the 
sourcebase without being caught?

Not trying to be a prick just...OUCH..seeing that hurt.  Some very 
serious people in the financial, scientific and government sectors 
depend on POI.  We owe them NOT to have THESE kinds of bugs go 
undetected.   (This is where you research and find I committed it haha)

-Andy
PS.  I finally figured out how to use SVN haha and even got my freaking 
account straightened out AND the apache mail servers are actually 
accepting my mails again!  WHooohoo!  Go ME!

-- 
No PST Files Ever Again
Buni Meldware Communication Suite
Email, Calendaring, ease of configuration/administration
http://buni.org


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/