Link in merged cells doesn't match the pattern CELL_REF_PATTERN in CellReference and this causes java.lang.IllegalArgumentException: Invalid CellReference: H9:L9 at org.apache.poi.ss.util.CellReference.separateRefParts(CellReference.java:403) at org.apache.poi.ss.util.CellReference.<init>(CellReference.java:118) at org.apache.poi.xssf.usermodel.XSSFSheet.removeOverwritten(XSSFSheet.java:3086) at org.apache.poi.xssf.usermodel.XSSFSheet.shiftRows(XSSFSheet.java:2975) at org.apache.poi.xssf.usermodel.XSSFSheet.shiftRows(XSSFSheet.java:2950)
I added r1899129 which is a partial fix for case where row shifting runs into individual hyperlinks that span multiple cells. It should help in your case because your cell range is all on row 9 (H9:L9). A workaround might be for you to iterate through the hyperlinks and replace the ones that have cell ranges with ones that are specific to 1 cell. XSSFSheet has public List<XSSFHyperlink> getHyperlinkList() which returns an unmodifiable list but you can try to use addHyperlink and removeHyperlink to add hyperlinks that are for one cell only and remove hyperlinks that are for multiple cells.
I added r1899137, 1899138 and r1899139 (and a few other commits prior to this) and they seem to indicate that my changes cover some of the most obvious scenarios.