DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=26916>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=26916


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|WONTFIX                     |




------- Additional Comments From [EMAIL PROTECTED]  2006-01-13 13:48 -------
I know longer have my original file, but looking at the 2.0 source, the problem 
is easy to see:

(HSSFDataFormat.java)
308    /**
309     * get the format string that matches the given format index
310     * @param index of a built in format
311     * @return string represented at index of format or null if there is not 
a builtin format at that index
313     */
314    public static String getBuiltinFormat( short index )
315    {
316        if ( builtinFormats == null )
317        {
318            populateBuiltinFormats();
319        }
320        return (String) builtinFormats.get( index );
321    }

The JavaDoc clearly states that a String will be returned, or if one doesn't 
exist at that index, null will be returned.  The implementation, however, has 
no guard to make sure its a valid index.  All that has to be done is to check 
to see if index is less than the size of the list before calling get(index).  
If the index is greater-than-or-equal-to the size of the list, then null should 
be returned.

There is a chance that I'm misunderstanding the intent of this method from the 
JavaDoc.  If that is the case, I suggest the JavaDoc be changed to clarify that 
it is possible for this method to throw an exception (instead of returning 
null) when a bad index is given.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to