Bug 59731

Summary: Consolidate duplicated code for row shifting
Product: POI Reporter: Javen O'Neal <onealj>
Component: SS CommonAssignee: POI Developers List <dev>
Status: NEW ---    
Severity: enhancement    
Priority: P2    
Version: 3.15-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   

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.