Bug 56914 - XSSFRowShifter.updateConditionalFormatting throws IOOBE when there are more than 1 CTConditionalFormatting
Summary: XSSFRowShifter.updateConditionalFormatting throws IOOBE when there are more t...
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.11-dev
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2014-09-04 12:25 UTC by Yaniv Kunda
Modified: 2014-09-05 19:08 UTC (History)
0 users

56914 (6.67 KB, patch)
2014-09-04 12:30 UTC, Yaniv Kunda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yaniv Kunda 2014-09-04 12:25:15 UTC
The iteration done over the sheet's CTConditionalFormatting objects possibly uses ctWorksheet.removeConditionalFormatting(j), but does not update the iteration index j.

For example, if there are 2 CTConditionalFormatting objects, and the first iteration removes it (at index 0), the second one fails to get it, since index 1 is already out of bounds.
Comment 1 Yaniv Kunda 2014-09-04 12:30:21 UTC
Created attachment 31964 [details]

Fixes the iteration problem by using a backwards iteration, and using more efficient one-time fetch of the XMLBeans array.
Modified BaseTestConditionalFormatting.testShiftRows to use two conditional formatting objects.
Comment 2 Andreas Beeker 2014-09-05 19:08:24 UTC
Thank you for the patch.
Applied with r1622759