Bug 59731 - Consolidate duplicated code for row shifting
Summary: Consolidate duplicated code for row shifting
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: SS Common (show other bugs)
Version: 3.15-dev
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2016-06-20 04:14 UTC by Javen O'Neal
Modified: 2016-06-20 04:23 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Javen O'Neal 2016-06-20 04:14:28 UTC
Row shifting code is implemented in o.a.p.xssf.usermodel.helpers.XSSFRowShifter and o.a.p.hssf.usermodel.HSSFSheet.

Some of the code is an exact copy-paste and all of the code is complicated enough that it warrants a standalone class. To avoid duplicated code, I suggest creating a RowShifter abstract class that implements the common behavior between XSSF and HSSF row shifting, and slowly migrating the methods related to row-shifting in HSSFSheet to HSSFRowShifter or just RowShifter.
Comment 1 Javen O'Neal 2016-06-20 04:23:56 UTC
r1749262 Added HSSFRowShifter and RowShifter classes, moved XSSFRowShifter#shiftMerged to RowShifter.

All 3 of the row shifter classes need unit tests. Right now the only coverage is from TestXSSFSheetShiftRows and TestHSSFSheetShiftRows.