Bug 43401 - Unable to outline and collapse rows >= 32767
Summary: Unable to outline and collapse rows >= 32767
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: Sun Solaris
: P1 major (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2007-09-14 15:07 UTC by Ross Mills
Modified: 2007-09-17 09:56 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Ross Mills 2007-09-14 15:07:02 UTC
Attempts to outline and collapse rows that include or come after 32767 results 
in a NullPointerException.
Comment 1 Ross Mills 2007-09-14 16:17:09 UTC
org.apache.poi.hssf.record.aggregates.RowRecordsAggregate was casting the row 
number to a short when calling RowRecord.setRowNumber.  This method takes an 
int - not a short.  I removed the cast and the problem was resolved.  Can 
someone please add this fix (or something like it) to the codebase.

My change is below...

    public RowRecord getRow(int rownum)

        // Integer integer = new Integer(rownum);
        RowRecord row = new RowRecord();

        //row.setRowNumber(( short ) rownum);  -- I commented this line out
        return ( RowRecord ) records.get(row);
Comment 2 Nick Burch 2007-09-17 09:56:06 UTC
Thanks, patch applied (with a few tweaks)