DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.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://nagoya.apache.org/bugzilla/show_bug.cgi?id=26916

ArrayIndexOutOfBoundsException in HSSFDataFormat.getBuiltinFormat

           Summary: ArrayIndexOutOfBoundsException in
                    HSSFDataFormat.getBuiltinFormat
           Product: POI
           Version: 2.0-dev
          Platform: PC
        OS/Version: Windows XP
            Status: UNCONFIRMED
          Severity: Major
          Priority: Other
         Component: HSSF
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


While attempting to read a workbook with skeletal test program, I encountered 
the following exception:

java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 191
        at java.util.Vector.get(Vector.java:716)
        at org.apache.poi.hssf.usermodel.HSSFDataFormat.getBuiltinFormat
(HSSFDataFormat.java:320)
        ...

The portion of my code which lead up to this was inside a double loop over each 
row, and each cell in the row:

        HSSFCellStyle style = cell.getCellStyle();
        short format = style.getDataFormat();
        String formatString = HSSFDataFormat.getBuiltinFormat(format);

The way I read the documentation, the HSSFDataFormat.getBuiltinFormat call 
should return a format String if one exists, or null.  In this case, however, 
neither happened.  Instead, I got an ArrayIndexOutOfBoundsException.

Unless I've missed something, I suspect either the documentation should be 
updated or the code altered.  For now, I'm going to attempt to work around this 
by checking the format index against 
HSSFDataFormat.getNumberOfBuiltinBuiltinFormats.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to