Summary: | ArrayIndexOutOfBoundsException in the HSSFSheet.groupColumn | ||
---|---|---|---|
Product: | POI | Reporter: | Anton Sharapov <asharapov> |
Component: | HSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux |
Description
Anton Sharapov
2008-08-17 04:08:46 UTC
A simple patch is to comment out the performance tuning with fromIdx in ColumnInfoRecordsAggregate.groupColumnRange(short fromColumn, short toColumn, boolean indent). It does not work because the column records are NOT ordered by column no: // taken from 3.1 FINAL org.apache.poi.hssf.record.aggregates.ColumnInfoRecordsAggregate: public void groupColumnRange(short fromColumn, short toColumn, boolean indent) { ... // OD bug fix: records NOT ordered by column no // fromIdx = columnIdx - 1; // subtract 1 just in case this column is collapsed later. ... } fixed in svn 694534. As you pointed out, the ColumnInfoRecords were not being kept in proper order. Rather than disable the optimisation, I fixed the logic to keep the records sorted. There were a few other methods besides groupColumnRange() that relied on proper ordering. Junit added for groupColumnRange() and collapseColumn()/expandColumn() |